How to center Google map marker with smooth zoom (api V3)?

I use map.panTo()to have a nice smooth transition between markers when I click from the list of locations, but I don’t see similar methods for scaling ... I imagine something like setZoom(13, 1500)where 1500 is the duration ...

any clue?

+5
source share
2 answers

The only built-in zoom function so far is map.setZoom, which does not allow you to change the speed.

If you want to set the map to a zoom level based on a set of markers, you can do something like this:

var bounds : LatLngBounds = new LatLngBounds(southwestmarker.getLatLng(), northeastmarker.getLatLng()); 
bounds.extend(someMarker.getLatLng());
//some more extend() here
map.setZoom(map.getBoundsZoomLevel(bounds)); 
0
source

, map.setZoom , 2 .

, 10, 12, . , 13, .

, ", ".

, /, .

2, , DOM . -webkit-transform: matrix(1, 0, 0, 1, -62, 71);. 1- 4- , - x-scale, - y-scale.

, transform: matrix(xs, 0, 0, ys, xt, yt);, xs ys - , 2, 200%. , 1,1 .. map.setZoom() .

, :

  • , Google.
  • , ( ) - . , , - , , , . "" , .
0

All Articles