Zoom Setting On Google Marker

dexter69

New Member
I wonder whether someone may be able to help me please.I'm using this page to allow users to view markers saved in a MySQL database and to geocode/reverse geocode new marker positions.I'm able to correctly center the map on the marker which is being loaded from the database, but the problem I'm having is that the map zooms in to it's maximum setting, whereas I would like to be able to set this manually.I've tried adding another zoom control into my script here:\[code\]// add markervar bounds = new google.maps.LatLngBounds(); var loc = new google.maps.LatLng(las,lgs);var marker = new google.maps.Marker({position: loc, map: window.map,zoom: 8,title: nms});bounds.extend(loc);map.fitBounds(bounds);\[/code\]Unfortunately this has no affect. I appreciate that to some this may be a very minor fix, but I've been looking at this for sometime and I just can't seem to find a solution.I just wondered whether someone may be able to look at this please and let me know where I've gone wrong?POST UPDATEI have worked out a solution using exisitng code and that suggested by @Andrew Leach. The working solution is:\[code\]// add markervar bounds = new google.maps.LatLngBounds(); var loc = new google.maps.LatLng(las,lgs);var marker = new google.maps.Marker({position: loc, map: window.map, title: nms});bounds.extend(loc);map.fitBounds(bounds);map.setZoom(16);\[/code\]
 
Top