acgis for Android加载天地图
程序员文章站
2022-05-25 15:45:27
示例代码
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(); } }
上一篇: J02-Java IO流总结二 《概述》
下一篇: 莞企实行智能改造 机器换人换出产品效益