ArcGis for Android Add and update graphicslayer layers

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.