Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

Thanks!!

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 at 6:22

1 Answer 1

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

 
discard

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.