简体   繁体   中英

Google Maps API Java Default Zoom

Im just wondering how to set a default zoom on my google maps application in java. I know in Javascript the call is to get the bounds and set the zoom to that, but is there any method of setting a default zoom level in Java (My application starts with an unzoomed look of the world)

Thanks, Matt

Hiii You can set you Zoom Level Using Below Code In Google Map.

var zoom = 10;
var map;
map = new OpenLayers.Map('map');
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

http://www.jappit.com/blog/midmaps-google-maps-java-me-library/ It actually depends on which API u are using in java the above link illustrates the usage of the GoogleMaps Class. if u are using some other class still the logic remains the same as in the above link. if there is no setZoom function in ur class. u might consider using this class or some other class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM