Google maps v3: the center of the borders is different from the center of the map

How is it possible that map.getCenter()may differ from map.getBounds().getCenter()?

> cragMap.getCenter()
> Q {d: 13.823563748466814, e: 0, toString: function, b: function, equals: function…}
> cragMap.getBounds().getCenter()
> Q {d: 5.9865924355766005, e: 0, toString: function, b: function, equals: function…}

This happens in my case and does not allow me to encode one specific function. Any idea what is the reason for this?

+3
source share
1 answer

This is due to the latitudinal nonlinearity of the projection of the mercard. map.getBounds().getCenter()returns the average of latDim and lngDim. But this average value usually differs from the center of the map, because the scale of latitude changes north and south.

+2
source

All Articles