Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Customised annotation callout closes automatically when changing the viewport #10919

Closed
pushian opened this issue Jan 12, 2018 · 7 comments
Closed
Labels
annotations Annotations on iOS and macOS or markers on Android archived Archived because of inactivity iOS Mapbox Maps SDK for iOS

Comments

@pushian
Copy link

pushian commented Jan 12, 2018

example

Platform: iOS
Mapbox SDK version: "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 3.7

Steps to trigger behavior

  1. Tap on the annotation
  2. The customised callout view will appear
  3. Move the map slightly a bit and the callout view will disappear

Expected behavior

The callout view should remain when the map is moving and should only be dismissed when the map is tapped somewhere else

Actual behavior

Move the map slightly a bit and the callout view will disappear

@pushian
Copy link
Author

pushian commented Jan 12, 2018

Hi @frederoni, I have gone through all the relevant issues and found this issue should have been fixed in the issue #6676 but I am still seeing it happening. Please advise.

@jmkiley jmkiley added iOS Mapbox Maps SDK for iOS annotations Annotations on iOS and macOS or markers on Android labels Jan 12, 2018
@frederoni
Copy link
Contributor

The MGLCalloutView protocol provides an optional dismissesAutomatically property. Is this property implemented in your concrete class and set to NO?

@pushian
Copy link
Author

pushian commented Jan 13, 2018

@frederoni thanks for the information and I have tried to set as following:
class CustomCalloutView: UIView, MGLCalloutView { var dismissesAutomatically = false }
It is working that the callout view will now remain when I am changing the viewport but the callout view is not moving together with the viewport. Is there any other settings that I have to implement to make the callout view moving also?
example2

@pushian
Copy link
Author

pushian commented Jan 13, 2018

I tried to implement the variable isAnchoredToAnnotation but it resulted in a very strange behaviour. Each time I click on one of the annotation, the callout view will always appear at the top left corner of the screen (check out the gif I have uploaded).
All the markers on the map are displayed using Features and Layers. I am using the following code to show the callout view:
func showCallout(feature: MGLPointFeature) {
let point = MGLPointFeature()
point.title = feature.attributes["name"] as? String
point.coordinate = feature.coordinate
mapView.selectAnnotation(point, animated: true)
}
example3

@stale
Copy link

stale bot commented Oct 29, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the archived Archived because of inactivity label Oct 29, 2018
@julianrex
Copy link
Contributor

Believe this is likely fixed in recent changes, however we should re-test.

@stale stale bot removed the archived Archived because of inactivity label Oct 29, 2018
@stale stale bot added the archived Archived because of inactivity label Apr 27, 2019
@stale
Copy link

stale bot commented Apr 27, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android archived Archived because of inactivity iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

4 participants