Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I add label or text on the ESRI's PictureMarkerSymbol (Javascript API)?

I could use any other marker as well that support labels.

share|improve this question
I have similar requirement. I am new to ArcGis, i need complete code of how to add dynamic text on the marker symbol. I have Location Data in Json format.... {locations: [{latitude: 52.1, longitude: 4.1, textToDisplayOnThePictureMarkerSymbol: 34}, {latitude: 52.2, longitude: 4.9, textToDisplayOnThePictureMarkerSymbol: 50}, ...]} Pls help me... – user34539 Jul 15 '14 at 6:22
up vote 2 down vote accepted

Add the marker and then add textSymbol to show labels on the markers. Like this:

var markerGraphic = layer.add(new esri.Graphic(point, new esri.symbol.PictureMarkerSymbol('images/pin.png', 38, 44).setOffset(0,15)));
var textSymbol = layer.add(new esri.Graphic(point, new esri.symbol.TextSymbol(counter).setOffset(0,12)));
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.