-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Implement Annotations For Clusters #61
Comments
There are different ways of implementing the Like this <Map>
<Annotation>I am a normal Annotation without a cluster</Annotation>
<Annotation clusteringIdentifier='cities'>I am a normal Annotation within the cities cluster</Annotation>
<Annotation clusteringIdentifier='cities' forCluster={true}>I am a AnnotationForCluster for the cities cluster</Annotation>
</Map> Alternatively we could implement the For the |
Thank you for your proposal! Having a component like the one in your code block sounds reasonable at first, but it’s not clear how we would get the member annotations. A hook like you propose doesn’t fully address the solution because users might want to set props on the annotation itself depending on the member annotations (e.g. to set the title or glyph of the annotation depending on the number of annotations in the cluster). Moving the hook above in the React tree doesn’t seem to clearly address the issue either, as it’s not clear how the annotations and the cluster annotations would be linked. I think that ideally, mapkit-react would manage <Map {…}>
<AnnotationGroup annotationForCluster={(memberAnnotations) => <Annotation {…} />}>
{/* All annotations within the AnnotationGroup automatically get the same clustering identifier */}
{viewpoints.map(viewpoint => <Annotation {…} />}
</AnnotationGroup>
</Map> If we go this way, we could deprecate |
I would like the customize the annotations used for clustering. Therefore I would recommend implementing
annotationForCluster
and possibly alsomemberAnnotations
.More Info: https://developer.apple.com/documentation/mapkitjs/map/2991319-annotationforcluster
And: https://developer.apple.com/documentation/mapkitjs/annotation/2991318-memberannotations
The text was updated successfully, but these errors were encountered: