I am trying to draw clusters -yellow circles- on a set of points -red dots- on the map
After getting the cluster centroid I calculated the circle radius by getting the furthest point from the cluster and I calculate the distance Euclidean distance and I am giving it the lat/long of the 2 points -the cluster centroid & the furthest point-
Now the problem I am having is this.
the distance between the 2 points does not give me the correct radius because when the zoom changes I should multiply with a factor or I should get the distance in KM or Miles and calculate how many pixels correspond to that distance and I am not sure How to do that?
The Information that I have. That might help the equation are:
ZoomLevel: Integer the current zoom scale [1, ....]
ZoomLevelDistanceRatio: Map{key: ZoomLevel, value: scale} scale is distance ex: 1000km, 200m
clusterCentroind: [lat: number, long: number] furthestPoint: [lat: number, long: number]