Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps default zoom level

Tags:

google-maps

I created a public map using my Google Map. I want to set a default zoom level, but it is not saved. Is this possible? Also, is it possible to change the list of place markers?

like image 854
Rick Avatar asked Mar 06 '26 00:03

Rick


1 Answers

the reference map that you supply (quebec summer festival) is called by the URL: http://maps.google.com/maps/ms?source=embed&hl=en&geocode=&ie=UTF8&msa=0&msid=112492115201367239282.0004609e0fcc239c4f792&ll=46.81084,-71.217113&spn=0.02056,0.038624&z=15

notice that the last parameter "&z=15" defines the zoom level (in the embed map code, "&z=15" becomes "& a m p ; z = 1 5" [remove spaces between letters]). if you change this you can increase or decrease the zoom level. if you suppress the zoom level, googlemaps will automatically calculate a zoom level when displaying said map. NORMALLY this leaves some of your map outside the frame.

so, just by supplying the URL with the desired zoomlevel you have solved your problem. this works very well with static maps. if you have a dynamically generated map (from a database, for example), the fastest solution is to put 2 markers (top left and bottom right corners) slightly outside your boundary box. this will force automatic zoom in the desired amount (hopefully).

like image 63
tony gil Avatar answered Mar 09 '26 00:03

tony gil