Friday 27 April 2018

How to obtain to Max zoom levels for Google layer using OpenLayers


I was trying to obtain maximum zoom level ( level 22) for Google street map using Openlayers.layer.google script.


The following code does not seem to work. It works to the maximum zoom level when the zoom variable is set to 15, but below or above 15, it sets centre to world extent.



Any idea what went wrong? we tried using Google maps API v2 and v3, same result for Maxmimum zoom, except for value = 15.


var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection);
var zoom = 22;
map.setCenter(position, zoom);


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...