Graphicslayer layer layers in ArcGIS are used to add marker lines and so on, for example, after clicking on a location, marking the current position on the map and using the current location as the map Center can use the following code:
drawable drawable = Getresources (). getdrawable (R.drawable.arrow); Picturemarkersymbol Picsymbol = new Picturemarkersymbol (drawable); Point loc= New Point (1.4191862462692365e7,5183685.4328131145);//Get position Graphic g = new Graphic (Loc, Picsymbol) ; Graphicslayer.addgraphic (g); Map.centerat (Loc, true);
If you want to update in real time, don't Graphicslayer.removeall (), and then re-add the layer, that's a card. Use the following code:
drawable drawable = Getresources (). getdrawable (R.drawable.arrow); Picturemarkersymbol Picsymbol = new Picturemarkersymbol (drawable); Point loc= New Point (1.4191862462692365e7,5183685.4328131145);//Get position Graphic g = new Graphic (Loc, Picsymbol) ; graphicslayer.updategraphic (1, g); Map.centerat (Loc, true);
ID is the ID of the element being added.
ArcGis for Android Add and update graphicslayer layers