jquery - Cannot center on the marker in Google Maps -


i have code below generate google map, map doesn't center @ marker. i've done research can't figure out.

the javascript code use:

if (status == google.maps.geocoderstatus.ok) {     latitude = results[0].geometry.location.lat();     longitude = results[0].geometry.location.lng();     $('#map_canvas').gmap('addmarker', { position: latitude + ',' + longitude, center: latitude + ',' + longitude, zoom: 10, draggable:false }); }  

try -

var c = new google.maps.latlng(latitude , longitude); $('#map_canvas').gmap('addmarker', { position: c , zoom: 10, draggable:false }); $('#map_canvas').gmap({'center': c}); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -