Edit Text on Map (runtime SDK for android)

571
2
06-25-2021 12:23 AM
LouiePang
New Contributor II

I'm writing a annotation placement on map function, while in "onSingleTapConfirmed"

Below text can be placed on map

TextSymbol ts =newTextSymbol(14,"some text",BLUE,CENTER,MIDDLE);
currentTextGraphic =newGraphic(mapPoint,ts);
mGraphicsOverlay.getGraphics().add(currentTextGraphic);

Cascade the created text on map, when user try to edit it, it show up as a "Point" and after save, the text turned into point system, e.g. only below determination failled into.

if (graphic.getGeometry().getGeometryType() == GeometryType.POINT) {

Or may I know if any method to check the "point" had "TextSymbol" before so that I can further udpate?

Tags(3)
0Kudos
2回答
PeterDimitrov1
Esri Contributor

Hello LouiePang,

我认为这个问题可能是所选的object that you are checking is a MapPoint, so you should try check if it is of type

Esri.ArcGISRuntime.Geometry.MapPoint


Regards,
Peter Dimitrov

0Kudos
LouiePang
New Contributor II

May I know how I can check if it is should be a Text/TextSymbol e.g. from the Graphic?
I'm using SketchEditor for placing the Text as mentioned, Or I should uses other way to do it?

My aims is to let user interactively place text on map, it will be good if can be move/edit content again.

Thx

0Kudos