Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1167
  • Last Modified:

Add a letter (A,B,C, etc) to a Google Map Marker

How can I use a STANDARD Google Map Marker & cause a different letter (A, B, C, etc.) to be superimposed on the marker?

Is it possible to use the "standard" marker & change it's color?

My code is in the code window.

Thank you.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="">
	<title>Test Geocoding Appts</title>
<style type="text/css">
.maintable td
	.pt18 {font-size: 18pt; font-family: Arial}
	.pt14 {font-size: 14pt; font-family: Arial}	
	.pt12 {font-size: 12pt; font-family: Arial}
	.pt11 {font-size: 11pt; font-family: Arial}
	.pt10 {font-size: 10pt; font-family: Arial}
	.pt8  {font-size: 8pt; font-family: Arial}
	.pt9  {font-size: 9pt; font-family: Arial}	
	.pt7  {font-size: 7pt; font-family: Arial}
<script src=";v=2.x&amp;key=ABQIAAAAH82qcpE-n4Sa6uJ45nihgxQmxjvj1xUHQRzNiSXUnkhbPQTbbxTo2fquIiNtppisdZ_VE_i29EBvWA" type="text/javascript"></script>
<script language="JavaScript">	
	var URL = unescape(location.href);
addrs = new Array();
	addrs[0] = "1356 N Crestline, Wichita, KS";
	addrs[1] = "1424 S Maize Rd, Wichita, KS";
	addrs[2] = "11415 Taft, Wichita, KS";
	addrs[3] = "9221 Suncrest, Wichita, KS";
	addrs[4] = "1837 Valley View, Wichita, KS";
	addrs[5] = "330 Kennedy, Wichita, KS";
	addrs[6] = "14915 Valley Hi Cir., Wichita, KS";
	addrs[7] = "12561 Hardtner, Wichita, KS";
	addrs[8] = "102 N Wood, Wichita, KS";
	addrs[9] = "2926 W Columbine, Wichita, KS";
	addrs[10] = "856 Country Acres, Wichita, KS";
	addrs[11] = "P O Box 75511, Wichita, KS";
	addrs[12] = "3529 S. Hiram, Wichita, KS";
	addrs[13] = "11004 W Binter, Wichita, KS";
	addrs[14] = "8210 W Aberdeen, Wichita, KS";
	addrs[15] = "5801 W 41st Cr S, Wichita, KS";
	addrs[16] = "1841 N. Valleyview, Wichita, KS";
	addrs[17] = "3026 N Topaz, Wichita, KS";
	addrs[18] = "543 Fawnwood Ct, Wichita, KS";
	addrs[19] = "1319 Covington Cir, Wichita, KS";
	addrs[20] = "221 N. Parkdale, Wichita, KS";
	addrs[21] = "503 N Wheatland Pl, Wichita, KS";
	addrs[22] = "4232 W Central, Wichita, KS";

 	var map = null; 
    var geocoder = null;
    var bounds = new GLatLngBounds(); 

    var geocoder;
    var currentAddress;
    function initialize() {
      if (GBrowserIsCompatible()) { 
        map = new GMap2(document.getElementById("map"), 100); 
        map.addControl(new GSmallMapControl()); 
        map.addControl(new GMapTypeControl()); 
        map.setCenter(new GLatLng(37.665, -97.327), 13); 
        geocoder = new GClientGeocoder(); 
        geocoder.getLocations(addrs[0], addMarkerToMap);
        currentAddress = 0;
    function addMarkerToMap(response){
        // Retrieve the latitude and longitude
            place = response.Placemark[0];      
            point = new GLatLng(place.Point.coordinates[1],
            //show larger view
            if(currentAddress == 0) map.setCenter(point, 9);
            //extend bound
            //add to map
            document.getElementById('mapProcInfo').innerHTML = 'Error while geocoding. Address is invalid!'
        //if we got more address call this function again
            geocoder.getLocations(addrs[currentAddress], addMarkerToMap);
            document.getElementById('mapProcInfo').innerHTML = 'Processing markeres. Please wait: ' + (currentAddress+1) + '/' + addrs.length;
            //hide info and zoom map to markers
            document.getElementById('mapProcInfo').innerHTML = '';

    function showAddrSngl(address) {
      if (geocoder) {
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
        function showAddress(address,number) { 
            if (geocoder) { 
                   function(point) { 
                        if (!point) { 
                                alert(address+" not found"); 
                        } else { 
                             if(number==0) { 
                             var marker = createMarker(point,address); 
        }//end of function showAddress 
        function createMarker(point,address) { 
           var marker = new GMarker(point); 
           GEvent.addListener(marker, "click", 
                function() { 
           return marker; 
        }//end of function createMarker  			
// -->

<body onload="initialize()" onunload="GUnload()">
<div class="pt14"><b>Appointments on a map for 11/16/10</b></div><br>

		<table class="maintable">
                    <div id="mapProcInfo"></div>
                    <div id="map" style="width: 650px; height: 450px"></div>



Open in new window

Richard Korts
Richard Korts
1 Solution
Molnar IstvánHelpDesk / ProgrammerCommented:

to create a custom marker with wizard and generate code: (selecting label marker from types you can add a label text)

to create a custom marker from image:

here are the iconpacks from google:,_in_10_Colors

hope i understand correctly your question
Richard KortsAuthor Commented:
That helps, I had already figured it out, appreciate the response.

Stay tuned for likely more Google Maps API Questions.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now