Select to view content in your preferred language

Adding a label next to static point on map

3257
1
Jump to solution
02-08-2016 06:21 AM
AvivDinitz
New Contributor

Hi,

I have static points on a map.

I use this code to draw them:

    point = GeometryEngine.project(longitude, latitude, mapSR);

    pointGraphic = new Graphic(point, symbol);

    graphicsLayer.addGraphic(pointGraphic);

The point is drawed on the map.

Now I want to add a label(?) to it - show under the drawn point it's longitude and latitude.

I can do it using text adding, but then when I resize the map, the text placement changes.

I want to put it like a label - let's say on the bottom right from the point.

I want it to be sensitive for zooming, and binded to the Point.

I read about dinamic labels, but it seems very complex for such a simple request.

How can I do this?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
nita14
by
Regular Contributor

Hi,

You can use TextSymbol and set offset accordingly. Another option is to use FeatureLayer (from SQLite local geodatabase), edit data with Labels set and enabled. I did not try the second approach, but it should work. 

Hope this helps a bit.

Regards,

Adma

View solution in original post

1 Reply
nita14
by
Regular Contributor

Hi,

You can use TextSymbol and set offset accordingly. Another option is to use FeatureLayer (from SQLite local geodatabase), edit data with Labels set and enabled. I did not try the second approach, but it should work. 

Hope this helps a bit.

Regards,

Adma