acgis for Android加载天地图
程序员文章站
2023-04-06 20:19:08
示例代码
package com.hvit.tianditu;
import android.app.activity;
import android.os.bundle;
i...
示例代码
package com.hvit.tianditu; import android.app.activity; import android.os.bundle; import com.esri.android.map.mapview; import com.esri.android.map.event.onzoomlistener; public class tiandituactivity extends activity { mapview mmapview ; tianditutiledmapservicelayer t_vec;//天地图矢量图 tianditutiledmapservicelayer t_cva;//天地图矢量标注 /** called when the activity is first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.map); mmapview = (mapview) findviewbyid(r.id.map_mapview);//创建mapview对象 t_vec = new tianditutiledmapservicelayer(tianditutiledmapservicetype.vec_c);//创建天地图对象 mmapview.addlayer(t_vec);//将矢量的天地图对象加载到地图图层 t_cva = new tianditutiledmapservicelayer(tianditutiledmapservicetype.cva_c);//创建标注 mmapview.addlayer(t_cva);//添加标注 mmapview.setonzoomlistener(new onzoomlistener() { }); } @override protected void ondestroy() { super.ondestroy(); } @override protected void onpause() { super.onpause(); mmapview.pause(); } @override protected void onresume() { super.onresume(); mmapview.unpause(); } }