Guest User

Untitled

a guest
Dec 18th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. var map;
  2. function Initialize() {
  3. google.maps.visualRefresh = true;
  4. var Tabriz = new google.maps.LatLng(38.07147, 46.30068);
  5.  
  6. var mapOptions = {
  7. zoom: 14,
  8. center: Tabriz,
  9. mapTypeId: google.maps.MapTypeId.G_NORMAL_MAP
  10. };
  11.  
  12. map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
  13.  
  14. var myLatlng = new google.maps.LatLng(53.40091, -2.994464);
  15.  
  16. var marker = new google.maps.Marker({
  17. position: myLatlng,
  18. map: map,
  19. title: 'Tate Gallery'
  20. });
  21.  
  22. marker.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png')
  23.  
  24. }
  25. $("document").ready(function () {
  26. var W_Id = null;
  27. var valid = null;
  28.  
  29.  
  30. Initialize();
  31. //////////////
  32.  
  33. //////////////
  34.  
  35.  
  36. ////////////////
  37. google.maps.event.addListener(map, "click", function (event) {
  38. // get lat/lon of click
  39. var clickLat = event.latLng.lat();
  40. var clickLon = event.latLng.lng();
  41.  
  42. // show in input box
  43. document.getElementById("Longitude").value = clickLat.toFixed(5);
  44. document.getElementById("Latitude").value = clickLon.toFixed(5);
  45.  
  46. var marker = new google.maps.Marker({
  47. position: new google.maps.LatLng(clickLat, clickLon),
  48. map: map
  49. });
  50. });
  51. ////////////////
  52.  
  53.  
  54.  
  55. });
Add Comment
Please, Sign In to add comment