javascript - Google maps zoom level migration v2 to v3 -
i'm migrating piece of google maps code in javascript v2 v3
the following v2 piece shows map center zoomed in, can see street names , specific details
var mapg = new gmap(document.getelementbyid("gmmap")); var point = new glatlng(52.6461049, 6.5583690); mapg.centerandzoom(point, 3);
i've tried migrating following
var point = new google.maps.latlng(52.6461049, 6.5583690); var mapoptions = { center: point, zoom: 3, maptypeid: google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("gmmap"), mapoptions);
the map centered @ exact same location zoom way off. there difference between zoom values in v2 , v3? or did migrate wrong way?
if change 3 15, zooming equal. since i'm migrating client environment, want same
v2 documentation: https://developers.google.com/maps/documentation/javascript/v2/introduction#loadingmap each map contains zoom level, defines resolution of current view. zoom levels between 0 (the lowest zoom level, in entire world can seen on 1 map) 19 (the highest zoom level, down individual buildings) possible within normal maps view. zoom levels vary depending on in world you're looking, data in parts of globe more defined in others. zoom levels 20 possible within satellite view.
v3 documentation: https://developers.google.com/maps/documentation/javascript/tutorial#mapoptions the initial resolution @ display map set zoom property, zoom 0 corresponds map of earth zoomed out, , higher zoom levels zoom in @ higher resolution.
and https://developers.google.com/maps/documentation/javascript/maxzoom?hl=en most roadmap imagery available zoom levels 0 18, example.
so should same. else wrong code, e.g. doing fitbounds() anywhere or method adjust zoom level?
Comments
Post a Comment