Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay Number on Marker for Google Maps
    primarykey
    data
    text
    <p>All, I've got the following code to display my markers on my maps:</p> <pre><code> &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function'){ window.onload = func } else { window.onload = function() { oldonload(); func(); } } } var map, infowin=new google.maps.InfoWindow({content:'moin'}); function loadMap() { map = new google.maps.Map( document.getElementById('map'), { zoom: 12, mapTypeId:google.maps.MapTypeId.ROADMAP, center:new google.maps.LatLng(&lt;?php echo $_SESSION['pav_event_latitude']; ?&gt;, &lt;?php echo $_SESSION['pav_event_longitude']; ?&gt;) }); addPoints(myStores); } function addPoints( points ) { var bounds=new google.maps.LatLngBounds(); for ( var p = 0; p &lt; points.length; ++p ) { var pointData = points[p]; if ( pointData == null ) {map.fitBounds(bounds);return; } var point = new google.maps.LatLng( pointData.latitude, pointData.longitude ); bounds.union(new google.maps.LatLngBounds(point)); createMarker( point, pointData.html ); } map.fitBounds(bounds); } function createMarker(point, popuphtml) { var popuphtml = "&lt;div id=\"popup\"&gt;" + popuphtml + "&lt;\/div&gt;"; var marker = new google.maps.Marker( { position:point, map:map } ); google.maps.event.addListener(marker, 'click', function() { infowin.setContent(popuphtml) infowin.open(map,marker); }); } function Store( lat, long, text ) { this.latitude = lat; this.longitude = long; this.html = text; } var myStores = [&lt;?php echo $jsData;?&gt;, null]; addLoadEvent(loadMap); &lt;/script&gt; </code></pre> <p>This works great. However I'm trying to say add a number over the marker so that people can relate the number on my site with the marker in Google Maps. How can I go about creating the number over top of my markers (on top of the actual icon and not in an information bubble)? </p> <p>Any help would be greatly appreciate! Thanks in advance!</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.
 

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