var lat = '<%=lat%>'; var lon = '<%=lon%>'; var pincode = '<%=mappincode%>'; function first() { if (!lat || !lon) { geocoder.geocode({ 'address': pincode }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { lat = results[0].geometry.location.lat(); lon = results[0].geometry.location.lng(); InitializeMap(); } }); } else { InitializeMap(); } } function InitializeMap() { var latlng = new google.maps.LatLng(lat, lon); var myOptions = { zoom: 13, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("Gmap"), myOptions); window.onload = first;
<div id ="Gmap" style="height: 300px; width: 600px; removed 25px; removed 25px;" ></div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)