views:

97

answers:

2

I'm trying to add a letter to my marker and then have multiple markers (14 to be accurate) with letters. l have so far done this without success. I'm a complete novice with code and google API.

Can you tell what code l need to add and where?

Below is my code:

<script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=....
  type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
  if (GBrowserIsCompatible()) {

    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GMapTypeControl());
    map.addControl(new GLargeMapControl());
    map.addControl(new GOverviewMapControl());
    map.addControl(new GScaleControl());


    var bounds = map.getBounds();
    var southWest = bounds.getSouthWest();
    var northEast = bounds.getNorthEast();
    var lngSpan = northEast.lng() - southWest.lng();
    var latSpan = northEast.lat() - southWest.lat();
    for (var i = 0; i < 10; i++) {
    var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
        southWest.lng() + lngSpan * Math.random());
    map.addOverlay(new GMarker(point));

    var point = new GLatLng(lat,ling);
    map.setCenter(point, 10);
    var marker = new GMarker(point);
    map.addOverlay(marker);

}

   GEvent.addListener(map, "moveend", function() {
   var center = map.getCenter();
   document.getElementById("message").innerHTML = center.toString();
   });



    map.setCenter(new GLatLng(lat,ling), 7);

  }
}
//]]>
</script>
<style type="text/css">

Venue Location

Thanks

+1  A: 

If you're trying to change the marker itself look at http://googlemapsmarkers.com - if you use their URL for your marker you can specify what the marker looks like:

http://googlemapsmarkers.com/v1/A/ff00ff/

JP
+1  A: 

Use the Charts API to generate markers:

http://code.google.com/apis/chart/docs/gallery/dynamic_icons.html#pins

broady
That works, I guess. The chart library is pretty flexible. Still, it's pretty messed up that you *this* is the way to do add letters to a map pin.
toby
I'm not sure what the problem is. What's wrong with using the Charts API? Providing lettered markers is beyond the scope of the Maps API itself. If you want green ones, try http://maps.gstatic.com/intl/en_us/mapfiles/marker_greenA.png (replace A with the desired letter)
broady