2

I know the similar questions have been asked before, but they are all in Android (Java).

While I need to draw a text inside a yellow circle (let's call the text + its outside circle a unit) on Google Map with JavaScript (take a look the picture below):

enter image description here

I looked into Google Map JavaScript API and only found the code about draw shapes on google map but cannot find any code which gives me an insight of drawing an unit.

halfer
  • 19,824
  • 17
  • 99
  • 186
Franva
  • 6,565
  • 23
  • 79
  • 144

1 Answers1

4

There is no built-in option.

possible workarounds:

  • a custom overlay(circles may be created via css) Demo
  • a serverside script that creates images with circle+number on the fly (based on url-parameters). These images may be used as icon
Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • wow, you are my hero! Is it possible to stick the unit at a specific geo-location?so when users drag and move maps, the unit will follow. cheers – Franva Apr 04 '14 at 00:25
  • 1
    the unit is sticky(it will follow when you drag the map), but the overlay is draggable too(the original task for this demo was to create a draggable custom overlay, see: http://stackoverflow.com/questions/22127626/can-we-make-custom-overlays-draggable-on-google-maps-v3/22143588#22143588). You only need to remove the drag-functionality: http://jsfiddle.net/doktormolle/4jSP7/11/ – Dr.Molle Apr 04 '14 at 00:35
  • excellent! Also, Dr.Molle, do you know how to add a map listener in SenCha Touch? I have asked that question for days, but no one has answered it.... http://stackoverflow.com/questions/22865259/how-to-add-map-listeners-onto-map-page – Franva Apr 05 '14 at 11:57
  • I'm not familiar with SenCha Touch, sorry. – Dr.Molle Apr 05 '14 at 12:46