You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Can I catch MGLAnnotationImage what I created? #5463
Regarding MGLAnnotationImage, are you asking whether there's a way to cache the MGLAnnotationImage? You can create an MGLAnnotationImage with a reuse identifier. In -[MGLMapViewDelegate mapView:imageForAnnotation:], you should first call -[MGLMapView dequeueReusableAnnotationImageWithIdentifier:] and return that value if it's non-null; then you only need to create a new MGLAnnotationImage if no image with that identifier could be dequeued.
Regarding scrollEnabled, what is the expected result and what is the behavior you're seeing instead?
I know how to use it, but when i creatd a MGLAnnotationImage over, can i find it using some method like [imageForAnnotation:annotation] ? it will returm me a MGLAnnotation
I suppose we could add an -imageForAnnotation: method to MGLMapView, but it's a low priority given that MGLAnnotationView has a richer API that probably meets your needs better anyways.
Can you open a separate bug about the scrolling issue, so we can keep the conversation clear? Thanks!
ok, thanks for answer my question, u could refer to MKMapView, it has a property named image, instead of using a special MGLAnnotationImage. Maybe mix MGLAnnotationImage and MGLAnnotationView is better. Sorry for my poor English
Activity
[-]can i catch MGLAnnotationImage what i created?[/-][+]Can I catch MGLAnnotationImage what I created?[/+]Paladinfeng commentedon Jun 24, 2016
I have another question, when i create a MGLMapView, and set scrollEnabled to no, i can't be penetrated
like MKMapView, it's different with System
1ec5 commentedon Jun 24, 2016
Regarding MGLAnnotationImage, are you asking whether there's a way to cache the MGLAnnotationImage? You can create an MGLAnnotationImage with a reuse identifier. In -[MGLMapViewDelegate mapView:imageForAnnotation:], you should first call -[MGLMapView dequeueReusableAnnotationImageWithIdentifier:] and return that value if it's non-null; then you only need to create a new MGLAnnotationImage if no image with that identifier could be dequeued.
Regarding scrollEnabled, what is the expected result and what is the behavior you're seeing instead?
Paladinfeng commentedon Jun 24, 2016
I know how to use it, but when i creatd a MGLAnnotationImage over, can i find it using some method like [imageForAnnotation:annotation] ? it will returm me a MGLAnnotation
Paladinfeng commentedon Jun 24, 2016
scrollEnabled, i mean, if i put a MGLMapView into a ScrollView, the MGLMapView doesn't affect the scrollView scrolling, u can see it in MKMapView
1ec5 commentedon Jun 24, 2016
I suppose we could add an -imageForAnnotation: method to MGLMapView, but it's a low priority given that MGLAnnotationView has a richer API that probably meets your needs better anyways.
Can you open a separate bug about the scrolling issue, so we can keep the conversation clear? Thanks!
Paladinfeng commentedon Jun 24, 2016
ok, thanks for answer my question, u could refer to MKMapView, it has a property named image, instead of using a special MGLAnnotationImage. Maybe mix MGLAnnotationImage and MGLAnnotationView is better. Sorry for my poor English
1ec5 commentedon Jun 24, 2016
No problem! Good idea about adding
imageto MGLAnnotationView; let’s track that in #5469.