<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script> function loadMap() { var currentMapPosition = new google.maps.LatLng($('#<%=txLatitude.ClientID %>').val(), $('#<%= txLongitude.ClientID %>').val()); var mapOptions = { center: currentMapPosition, zoom: 14, mapTypeId: google.maps.MapTypeId.ROADMAP }; var infoWindow = new google.maps.InfoWindow(); var latlngbounds = new google.maps.LatLngBounds(); var map = new google.maps.Map(document.getElementById("gmap-dialog"), mapOptions); var marker = new google.maps.Marker({ position: currentMapPosition, map: map, title: 'SubProject Location' }); //collects New Location, and closing dialog on click google.maps.event.addListener(map, 'click', function (e) { var latitude = e.latLng.lat(); var longitude = e.latLng.lng(); var marker = new google.maps.Marker({ position: e.latLng, map: map, title: 'SubProject Location' }); // Center of map map.panTo(new google.maps.LatLng(latitude,longitude)); $('#<%= txLatitude.ClientID %>').val(e.latLng.lat() ) ; $('#<%= txLongitude.ClientID %>').val(e.latLng.lng() ) ; $("#gmap-dialog").dialog('close'); }); $("#gmap-dialog").dialog('open'); } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)