Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From actual code:</p> <pre><code>var image = './beachflag.png'; [...] var marker=new google.maps.Marker({ position: myPosition, map: map, icon: image }); </code></pre> <p>Your code:</p> <pre><code>var point = new google.maps.LatLng(37.984798,-121.312094); var marker = createMarker(point,'&lt;div style="width:205px"&gt;&lt;center&gt;&lt;img src="images/sampleuopsign.jpg" /&gt;&lt;/center&gt;&lt;h2&gt;University of the Pacific&lt;/h2&gt;3601 Pacific Avenue&lt;br&gt;Stockton, California 95211&lt;br&gt;209.946.2011&lt;br&gt;&lt;small&gt;On the web visit: &lt;a href="http://www.pacific.edu"&gt;www.Pacific.edu&lt;\/a&gt;&lt;/small&gt;&lt;\/div&gt;'); var image = 'icons/orange_arrow.png'; // this will be gmarkers[0] </code></pre> <p>What you need to do:</p> <pre><code>var point = new google.maps.LatLng(37.984798,-121.312094); var image = 'icons/orange_arrow.png'; // this will be gmarkers[0] var marker = createMarker(point,'&lt;div style="width:205px"&gt;&lt;center&gt;&lt;img src="images/sampleuopsign.jpg" /&gt;&lt;/center&gt;&lt;h2&gt;University of the Pacific&lt;/h2&gt;3601 Pacific Avenue&lt;br&gt;Stockton, California 95211&lt;br&gt;209.946.2011&lt;br&gt;&lt;small&gt;On the web visit: &lt;a href="http://www.pacific.edu"&gt;www.Pacific.edu&lt;\/a&gt;&lt;/small&gt;&lt;\/div&gt;', image); </code></pre> <p>And change CreateMarker:</p> <pre><code>function createMarker(latlng, html, img) { </code></pre> <p>// Note here the addition of the <strong>img</strong> parameter</p> <pre><code> var contentString = html; var marker = new google.maps.Marker({ position: latlng, map: map, ***icon: img,*** zIndex: Math.round(latlng.lat()*-100000)&lt;&lt;5 }); [...] </code></pre> <p><strong>EDIT</strong> A quick test with your code and my mods. <img src="https://i.stack.imgur.com/vELQr.png" alt="I set a few markers to a flag"></p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. 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