Guest User

Untitled

a guest
Apr 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. function initialize() {
  2. var latlng = new google.maps.LatLng("<%=Html.Encode(Model.Field01.Field01) %>", "<%=Html.Encode(Model.Field01.Field03) %>");
  3. var myOptions = {
  4. zoom: 13,
  5. center: latlng,
  6. disableDefaultUI: false,
  7. navigationControl: true,
  8. navigationControlOptions: {style: google.maps.NavigationControlStyle.ZOOM_PAN},
  9. navigationControl: true,
  10. mapTypeId: google.maps.MapTypeId.ROADMAP
  11.  
  12. };
  13. var map = new google.maps.Map(document.getElementById("mapcontainer"), myOptions);
  14.  
  15. map.getMinimumResolution = function() { return 6 };
  16.  
  17. var marker = new google.maps.Marker({
  18. position: latlng,
  19. map: map,
  20. title: "<%=Model.AccomName %>"
  21. });
  22. }
  23.  
  24. map.getMinimumResolution = function() { return 6 };
  25.  
  26. var mt = map.getMapTypes();
  27.  
  28. for (var i=0; i<mt.length; i++) {
  29. mt[i].getMinimumResolution = function() {return 6;}
  30. }
  31.  
  32. var inProcess = false;
  33.  
  34. function onZoomChanged() {
  35. if (inProcess) return;
  36.  
  37. if (gmap.getZoom() > 16) {
  38. inProcess = true;
  39. gmap.setZoom(16);
  40. inProcess = false;
  41. return
  42. }
  43. else if (gmap.getZoom() < 10) {
  44. inProcess = true;
  45. gmap.setZoom(10);
  46. inProcess = false;
  47. return;
  48. }
  49. }
  50.  
  51. google.maps.event.addListener(gmap, 'zoom_changed', onZoomChanged);
  52.  
  53. <script type="text/javascript>
  54. var latlng = new google.maps.LatLng(42.3493337, 13.398172299999942);
  55. var options = {
  56. zoom: 8,
  57. minZoom: 6,
  58. maxZoom: 10,
  59. center: latlng,
  60. mapTypeId: google.maps.MapTypeId.TERRAIN
  61. };
  62.  
  63. map = new google.maps.Map(document.getElementById("map_canvas"), options);
  64. </script>
  65.  
  66. google.maps.event.addListener(map, "zoom_changed", function() {
  67. if (map.getZoom() > 12) map.setZoom(12);
  68. });
  69.  
  70. // force normal maps type
  71. map.setMapType(G_NORMAL_MAP);
  72.  
  73. // define minimum and maximum zoom levels
  74. G_NORMAL_MAP.getMinimumResolution = function() { return 0; }
  75. G_NORMAL_MAP.getMaximumResolution = function() { return 19; }
Add Comment
Please, Sign In to add comment