Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 3.37 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Google Maps: Overlay point not showing up
  2. <head>
  3.     <title>Test Google Maps</title>
  4.  
  5.     <script src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyAXsNu2EwRNqKJn9OmC19WPkEJFM0r6ALk&sensor=true"
  6.         type="text/javascript"></script>
  7.  
  8.     <script type="text/javascript">
  9.  
  10.         function initialize() {
  11.  
  12.             // var myOptions = {
  13.             //     zoom: 16,
  14.             //     center: new google.maps.LatLng(40.750159, -73.976473),
  15.             //     disableDefaultUI: true,
  16.             //     mapTypeId: google.maps.MapTypeId.ROADMAP
  17.             //   }
  18.  
  19.             // var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  20.  
  21.             // var point = new GLatLng(40.750159, -73.976473);
  22.             // map.addOverlay(new GMarker(point));
  23.  
  24.             var map = new GMap2(document.getElementById("map_canvas"));
  25.             map.setCenter(new GLatLng(40.750159, -73.976473), 13);
  26.             map.setUIToDefault();
  27.  
  28.             var myGeographicCoordinates = new GLatLng(40.750159, -73.976473)
  29.             map.addOverlay(new GMarker(myGeographicCoordinates));
  30.  
  31.             // map.addOverlay(new GMarker(40.750159, -73.976473));
  32.  
  33.  
  34.         }
  35.  
  36.     </script>
  37.  
  38. </head>
  39.  
  40. <body onload="initialize()" onunload="GUnload()">
  41.     <div id="map_canvas" style="width: 450px; height: 370px"></div>
  42. </body>
  43.        
  44. <head>
  45.     <title>Test Google Maps</title>
  46.  
  47.     <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
  48.  
  49.     <script type="text/javascript">
  50.  
  51.         function initialize() {
  52.  
  53.             var myOptions = {
  54.                 zoom: 16,
  55.                 center: new google.maps.LatLng(40.750159, -73.976473),
  56.                 disableDefaultUI: true,
  57.                 mapTypeId: google.maps.MapTypeId.ROADMAP
  58.               }
  59.  
  60.             var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  61.  
  62.             var myGeographicCoordinates = new google.maps.LatLng(40.750159, -73.976473);
  63.  
  64.             var marker = new google.maps.Marker({
  65.                 map:        map,
  66.                 position:   myGeographicCoordinates,
  67.                 title:      "My First Test Marker",
  68.                 visible:    true
  69.             });
  70.             }
  71.  
  72.     </script>
  73.  
  74. </head>
  75.  
  76. <body onload="initialize()" onunload="GUnload()">
  77.     <div id="map_canvas" style="width: 450px; height: 370px"></div>
  78. </body>
  79.        
  80. new GLatLng(40.750159, -73.976473);
  81.        
  82. new google.maps.LatLng(40.750159, -73.976473);
  83.        
  84. var marker = new google.maps.Marker({
  85.     map:        map,
  86.     position:   latLng
  87. });
  88.        
  89. function initialize() {
  90.  var myOptions = {
  91.   zoom: 16,
  92.   center: new google.maps.LatLng(40.750159, -73.976473),
  93.   disableDefaultUI: true,
  94.   mapTypeId: google.maps.MapTypeId.ROADMAP
  95.  }
  96.  
  97.  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  98.  var myGeographicCoordinates = new GLatLng(40.750159, -73.976473);
  99.  var marker = new google.maps.Marker({
  100.   map:        map,
  101.   position:   myGeographicCoordinates
  102.  });
  103. }
  104.        
  105. map.addOverlay(new GMarker(myGeographicCoordinates));
  106.        
  107. var marker = new google.maps.Marker({
  108.     map:        map,
  109.     position:   myGeographicCoordinates,
  110.     title:      "My First Test Marker",
  111.     visible:    true
  112. });
  113.        
  114. var marker = new google.maps.Marker({
  115.     map:        map,
  116.     icon:       "images/my-nice-marker.png",
  117.     position:   myGeographicCoordinates,
  118.     title:      "My First Test Marker",
  119.     visible:    true
  120. });