ArcGIS for Android sample resolved offline map-----Localtiledlayer

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/wozaifeiyang0/article/details/7327423

Localtiledlayer

See whether the title is very excited, title, the example is to add an offline map, this should be a lot of developers long-awaited features, the official version of this should be a big highlight, the original operation offline map is so simple, the following look at the code:

Public void onCreate (Bundle savedinstancestate) {

Super. OnCreate (savedinstancestate);

Setcontentview (r.layout. Main);

Map = (Mapview) Findviewbyid (r.id. Map);

The data is stored on the SDcard

The data is created as a tiled cache

Local = new arcgislocaltiledlayer ("File:///mnt/sdcard/<CacheName>/Layers");

Map.addlayer (local);

}

See, the code is not much, but the essence, we just copy the offline map cache tiles to our SD card, and then modify the corresponding path in the Arcgislocaltiledlayer can display an offline map, do not forget to add the offline map service to the " Mapview "in.

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.