ThinkGeo.com    |     Documentation    |     Premium Support

Labeling of Markers

Hi,


I would like to know if there is anyway to label markers in the same fashion as labeling features using the TextStyle (CustomStyles) of an InMemoryLayer.  If not, I guess I will have to create another InMemoryLayer with features at the same position as the markers and then label?



Tony, 


Marker is not supposed to be very complicated as each marker is an independent image on the client part, adding text on a marker means we need to redraw that image. As a result, we can only draw text on top of the marker instead of showing the text around the marker (like upperleft, lowerRight).
 
We only support simply styles for a marker; you can change the fontColor, fontStyle and Rotation of a marker but cannot set the advanced style on it. Here is a good sample showing what we can do on markers.
 
websamples.thinkgeo.com/webeditionsamples/Samples/Markers/LabelAndRotateAMarker.aspx
 
So if you have some text to label, as you said, you need to create another inMemoryLayer and label the markers there.  
 
Any queries please let us know.
 
Ben