The following code works fine for me, but I can’t add the zoom level. According to docs , it should work with 'option', 'zoom', 7, but this gives an error:"$("#map_canvas").gmap("option", "zoom", 7).bind is not a function"
Working code, without scaling, edited. The scale is always 1.
$("#map_trigger").click(function(){
var prop_id = $("#map_canvas").attr("rel");
$('#map_canvas').gmap({'zoom':6}).bind('init', function(evt, map) {
$.getJSON( basepath+'properties/get_gps_coords/'+prop_id, function(data) {
$.each( data.markers, function(i, m) {
lat = m.latitude;
longitude = m.longitude;
$('#map_canvas').gmap(
'addMarker', { 'position': new google.maps.LatLng(lat, m.longitude), 'bounds':true }
);
});
});
});
});
How to add zoom level to this fragment?
source
share