function myFunction() { alert('hello'); var fname = document.getElementById('<%=hidden.ClientID%>').value; alert(fname); var mapOptions = { zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP } var infowindow = new google.maps.InfoWindow(); var map = new google.maps.Map(document.getElementById('displayMap'), mapOptions); $.ajax({ type: "GET", url: "Location\\" + fname + "", dataType: "xml", success: function (xml) { $(xml).find("Location").each(function () { Loc = $(this).find("Loc_Name").text(); Lat = $(this).find("Latitude").text(); Long = $(this).find("Longitude").text(); var loc = new google.maps.LatLng(Lat, Long); map.setCenter(loc); var marker = new google.maps.Marker({ position: new google.maps.LatLng(Lat, Long), map: map, title: 'My workplace', icon: 'http://google-maps-icons.googlecode.com/files/factory.png' }); google.maps.event.addListener(marker, 'click', function () { infowindow.setContent(Loc); infowindow.open(map, marker); }); }); } }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)