How can I add a geolocation mark and do a zoom there in a Cluster Marks of Nokia Maps?

StackOverflow https://stackoverflow.com/questions/15027243

  •  11-03-2022
  •  | 
  •  

Question

This is the example that I've been using: Nokia Maps Cluster

But I couldn't add a new mark of geolocation I've tried with the HTML5 API but I think I don't how to implement it, I hope somebody could tell me what I need to change. Thank you very much for your help.

Was it helpful?

Solution

To add a point to a cluster you need to call clusterProvider.add(), to add a series of points just use clusterProvider.addAll() instead, Each of these methods take an IClusterPoint (or an array of IClusterPoints ), which is basically means they will accept any object with a longitude and latitude.

If you really want to add a geolocation to your cluster you'll need to do the following steps:

  1. Make an HTML5 geolocation call as in this example here
  2. Instead or then reverse geocoding, take the response and add it to your cluster.

The actual clustering is triggered by the method clusterProvider.cluster() as shown:

clusterProvider.addAll(markers);
clusterProvider.cluster();

see the API documentation for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top