mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-09 05:44:34 +00:00
[iOS] Add Panoramax link on the place page
Signed-off-by: Jean-Baptiste Charron <jeanbaptiste.charron@outlook.fr> Co-authored by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
25e49b0fe1
commit
df89761eba
@@ -86,6 +86,7 @@ protocol PlacePageInfoViewControllerDelegate: AnyObject {
|
||||
func didPressVk()
|
||||
func didPressLine()
|
||||
func didPressBluesky()
|
||||
func didPressPanoramax()
|
||||
func didPressEmail()
|
||||
func didPressOpenInApp(from sourceView: UIView)
|
||||
func didCopy(_ content: String)
|
||||
@@ -118,6 +119,7 @@ class PlacePageInfoViewController: UIViewController {
|
||||
private var vkView: InfoItemViewController?
|
||||
private var lineView: InfoItemViewController?
|
||||
private var blueskyView: InfoItemViewController?
|
||||
private var panoramaxView: InfoItemViewController?
|
||||
private var cuisineView: InfoItemViewController?
|
||||
private var operatorView: InfoItemViewController?
|
||||
private var wifiView: InfoItemViewController?
|
||||
@@ -361,6 +363,18 @@ class PlacePageInfoViewController: UIViewController {
|
||||
self?.delegate?.didCopy(bluesky)
|
||||
})
|
||||
}
|
||||
|
||||
if let panoramax = placePageInfoData.panoramax {
|
||||
panoramaxView = createInfoItem(panoramax,
|
||||
icon: UIImage(named: "ic_placepage_panoramax"),
|
||||
style: .link,
|
||||
tapHandler: { [weak self] in
|
||||
self?.delegate?.didPressPanoramax()
|
||||
},
|
||||
longPressHandler: { [weak self] in
|
||||
self?.delegate?.didCopy(panoramax)
|
||||
})
|
||||
}
|
||||
|
||||
if let address = placePageInfoData.address {
|
||||
addressView = createInfoItem(address,
|
||||
|
||||
@@ -128,6 +128,10 @@ extension PlacePageInteractor: PlacePageInfoViewControllerDelegate {
|
||||
MWMPlacePageManagerHelper.openBluesky(placePageData)
|
||||
}
|
||||
|
||||
func didPressPanoramax() {
|
||||
MWMPlacePageManagerHelper.openPanoramax(placePageData)
|
||||
}
|
||||
|
||||
func didPressEmail() {
|
||||
MWMPlacePageManagerHelper.openEmail(placePageData)
|
||||
}
|
||||
|
||||
@@ -293,6 +293,11 @@ using namespace storage;
|
||||
[self.ownerViewController openUrl:ToNSString(fullUrl) externally:YES];
|
||||
}
|
||||
|
||||
- (void)openPanoramax:(PlacePageData *)data {
|
||||
std::string const fullUrl = osm::socialContactToURL(osm::MapObject::MetadataID::FMD_PANORAMAX, [data.infoData.panoramax UTF8String]);
|
||||
[self.ownerViewController openUrl:ToNSString(fullUrl) externally:YES];
|
||||
}
|
||||
|
||||
- (void)openEmail:(PlacePageData *)data {
|
||||
[MailComposer sendEmailWithSubject:nil body:nil toRecipients:@[data.infoData.email] attachmentFileURL:nil];
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
+ (void)openVk:(PlacePageData *)data;
|
||||
+ (void)openLine:(PlacePageData *)data;
|
||||
+ (void)openBluesky:(PlacePageData *)data;
|
||||
+ (void)openPanoramax:(PlacePageData *)data;
|
||||
+ (void)call:(PlacePagePhone *)phone;
|
||||
+ (void)showAllFacilities:(PlacePageData *)data;
|
||||
+ (void)showPlaceDescription:(NSString *)htmlString;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
- (void)openVk:(PlacePageData *)data;
|
||||
- (void)openLine:(PlacePageData *)data;
|
||||
- (void)openBluesky:(PlacePageData *)data;
|
||||
- (void)openPanoramax:(PlacePageData *)data;
|
||||
- (void)call:(PlacePagePhone *)phone;
|
||||
- (void)showAllFacilities:(PlacePageData *)data;
|
||||
- (void)showPlaceDescription:(NSString *)htmlString;
|
||||
@@ -119,6 +120,10 @@
|
||||
[[MWMMapViewControlsManager manager].placePageManager openBluesky:data];
|
||||
}
|
||||
|
||||
+ (void)openPanoramax:(PlacePageData *)data {
|
||||
[[MWMMapViewControlsManager manager].placePageManager openPanoramax:data];
|
||||
}
|
||||
|
||||
+ (void)call:(PlacePagePhone *)phone {
|
||||
[[MWMMapViewControlsManager manager].placePageManager call:phone];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user