function drawMarkers(markerList) { debugger; var mapOptions = { center: new google.maps.LatLng(markerList[0].Latitude, markerList[0].Longitude), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var currentLocation; var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions); var infoWindow = new google.maps.InfoWindow(); var lat_lng = new Array(); var latlngbounds = new google.maps.LatLngBounds(); for (i = 0; i < markerList.length; i++) { var data = markerList[i] var address = data.DeliveryAddress; var myLatlng = new google.maps.LatLng(data.Latitude, data.Longitude); lat_lng.push(myLatlng); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: data.DriverName, }); var geocoder = new google.maps.Geocoder(); if (geocoder) { geocoder.geocode({ 'address': address }, function (results, status) { debugger; if (status == google.maps.GeocoderStatus.OK) { var latitude = results[0].geometry.location.lat(); var longitude = results[0].geometry.location.lng(); } }); } } map.setCenter(latlngbounds.getCenter()); map.fitBounds(latlngbounds); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)