Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I did this a while back with the following approach. When I declared my marker I used.</p> <pre><code>var marker = createMarker(map,point,label,html,rank,type); </code></pre> <p>Then</p> <pre><code>function createMarker(map, latlng, title, html, rank,type) { var image = new google.maps.MarkerImage("images/goldPin.png", // This marker is 24 pixels wide by 37 pixels tall. new google.maps.Size(24, 37), // The origin for this image is 0,0. new google.maps.Point(0,0), // The anchor for this image is the base of the flagpole at 0,37. new google.maps.Point(15, 20)); var shadow = new google.maps.MarkerImage('images/goldPinShadow.png', // The shadow image is larger in the horizontal dimension // while the position and offset are the same as for the main image. new google.maps.Size(31, 37), new google.maps.Point(0,0), new google.maps.Point(15, 20)); // Shapes define the clickable region of the icon. // The type defines an HTML &lt;area&gt; element 'poly' which // traces out a polygon as a series of X,Y points. The final // coordinate closes the poly by connecting to the first // coordinate. var shape = { coord: [1, 1, 1, 20, 18, 20, 18 , 1], type: 'poly' }; switch (type) { case "general": var markerOptions = { title: title, shadow: shadow, icon: image, shape: shape, position: latlng, map: map } break; /* more types go here */ } var marker = new google.maps.Marker(markerOptions); google.maps.event.addListener(marker, "click", function() { var infowindowOptions = { content: html } var infowindow = new google.maps.InfoWindow(infowindowOptions); setInfowindow(infowindow); infowindow.open(map, marker); }); google.maps.event.addListener(marker, "mouseover", function() { }); google.maps.event.addListener(marker, "mouseout", function() { }); return marker; } </code></pre> <p>Let me not forget to mention that I used custom markers with my application which I strongly encourage.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload