I
I
Ivan Gnatyuk2020-09-14 16:29:43
iOS
Ivan Gnatyuk, 2020-09-14 16:29:43

Generating a label image on the fly as it emerges from the cluster?

I add 3000 labels to the map using a clusterer. Clusters are added, everything is ok.

I add like this:

clusterizedPlacemarkCollection.addPlacemarks(with: points,
                                 image: UIImage(named: "mapMarker")!,
                                 style: YMKIconStyle())
    
clusterizedPlacemarkCollection.clusterPlacemarks(withClusterRadius: 60, minZoom: 15)


But in this way, the same picture is set for all labels. I also need to expose almost a unique picture for each label. The pictures of the tags themselves are "complex", they are formed from several pictures and text, each tag has its own picture. Creating immediately and assigning 3000 pictures to labels is not an option - too labor-intensive operation.

Google.Maps has for example a method
renderer(_ renderer: GMUClusterRenderer, willRenderMarker marker: GMSMarker)
, which allows you to receive an event when the label should be displayed, and in this method create and assign the desired image. I can’t find this in the Yandex.Maps SDK, is it even possible?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question