1

My code below will show the green color marker but I need to show the letter 'k' inside the marker. How would I do this?

var marker={
    "title": "Kathmandu",
    "lat":27.700,
    "lng":85.333333300000050 ,
    "description": "Kathmandu,Bagmati,Neapal<br>[i]"
}
var marker = new google.maps.Marker({
    position: myLatlng,
    map: map,
    icon:'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
    title: data.title
});
Chris Spittles
  • 15,023
  • 10
  • 61
  • 85
  • I used this icon: 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000' but i have to use this for multiple markers each marker with different alphabets how can i? – user3713826 Jun 19 '14 at 09:40
  • 1
    what's you problem? this seems to work: http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=K|00ff00|000000 – pataluc Jun 19 '14 at 09:42
  • Edit the image with paint/photoshop , and change the image url , for example this could be your substitue icon http://icons.iconarchive.com/icons/icons-land/vista-map-markers/32/Map-Marker-Flag-3-Left-Chartreuse-icon.png – Mustafa sabir Jun 19 '14 at 09:43
  • If we used multiple markers like 'chennai','mumbai' how can i insert the letter c for chennai and letter m for mumbai? – user3713826 Jun 19 '14 at 09:49
  • 1
    Be aware that: *Important: The Infographics portion of Google Chart Tools has been officially deprecated as of April 20, 2012.* – MrUpsidown Jun 19 '14 at 10:03
  • A nice collection: http://mapicons.nicolasmollet.com/numbers-letters/letters/ – MrUpsidown Jun 19 '14 at 10:09
  • If PHP is an option, you can [have a look at this answer](http://stackoverflow.com/questions/19296323/google-maps-marker-set-background-color/20778505#20778505) and adapt this to your needs. The provided answer was to change the marker background color but you can also use PHP to write text on your PNG. [PHP imagestring](http://www.php.net//manual/en/function.imagestring.php), [PHP imagettftext](http://www.php.net//manual/en/function.imagettftext.php). – MrUpsidown Jun 19 '14 at 10:15

0 Answers0