Getting map zoom level for given bounds on Android like on JS Google Maps API: map.getBoundsZoomLevel(bounds)

前端 未结 3 1872
臣服心动
臣服心动 2021-02-09 10:23

I have a cluster marker that defines a bounding rectangle containing a group of markers. The cluster has a center (lat,lon), a marker count and a latitude and longitude span to

3条回答
  •  迷失自我
    2021-02-09 10:55

    I didn't tried this but maybe it will work for you. Imagine you have a rectangle (x1,y1)-(x2,y2)

        MapController c = mapView.getController();
        c.setCenter(new GeoPoint((x1+x2)/2,(y1+y2)/2));
        c.zoomToSpan(x2, y2);
    

提交回复
热议问题