Arcgis android 离线编辑实现及一些代码段

底图添加

private String path="file:///mnt/sdcard/data/chinasimple.tpk";

mMapView = (MapView)findViewById(R.id.maplocal);

mMapView.addLayer(new ArcGISLocalTiledLayer(path));

<com.esri.android.map.MapView

xmlns:android="http://schemas.android.com/apk/res/android"

android:id="@+id/maplocal"

android:layout_width="fill_parent"

android:layout_height="fill_parent"/>

看一看menu.add方法的参数:
 
    
第一个int类型的group ID参数,代表的是组概念,你可以将几个菜单项归为一组,以便更好的以组的方式管理你的菜单按钮。
    
 
第二个int类型的item ID参数,代表的是项目编号。这个参数非常重要,一个item ID对应一个menu中的选项。在后面使用菜单的时候,就靠这个item ID来判断你使用的是哪个选项。
    
 
第三个int类型的order ID参数,代表的是菜单项的显示顺序。默认是0,表示菜单的显示顺序就是按照add的显示顺序来显示。
    
 
第四个String类型的title参数,表示选项中显示的文字

菜单

@Override

public
boolean onCreateOptionsMenu(Menu menu) {

//
TODO Auto-generated method stub

//      getMenuInflater().inflate(R.menu.offlinepreferences,
menu);

menu.add(0, 1, 1, "设置");

menu.add(0, 2, 2, "退出");

return
super.onCreateOptionsMenu(menu);

}

事件监听

@Override

public boolean onOptionsItemSelected(MenuItem item) {

// TODO Auto-generated method stub

if(item.getItemId() == 1){

Toast.makeText(EditDemoActivity.this, "shezhi",
Toast.LENGTH_SHORT).show();

}

else if(item.getItemId() == 2){

finish();

}

return true;

}

去掉标题栏

android:theme="@android:style/Theme.NoTitleBar"

加入进度条右上角

this.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

setProgressBarIndeterminateVisibility(false);//设置为不显示

添加tab栏及自定义

private void addTab() {

tabHost=(TabHost)findViewById(R.id.tabhost);

tabHost.setup();

tabSpec1=tabHost.newTabSpec("tab1");

tabSpec1.setContent(R.id.tab1);

tabSpec1.setIndicator("下载");

tabHost.addTab(tabSpec1);

tabSpec2=tabHost.newTabSpec("tab2");

tabSpec2.setContent(R.id.tab2);

tabSpec2.setIndicator("编辑");

tabHost.addTab(tabSpec2);

tabSpec3=tabHost.newTabSpec("tab2");

tabSpec3.setContent(R.id.tab3);

tabSpec3.setIndicator("同步");

tabHost.addTab(tabSpec3);

TabWidget
tWidget=tabHost.getTabWidget();

for (int
i=0;i<tWidget.getChildCount();i++)

{

View
view=tWidget.getChildAt(i);

view.getLayoutParams().height=70;

final
TextView tv = (TextView) view.findViewById(android.R.id.title);

tv.setTextSize(20);//设置字体高度

}

}

featureLayer显示的3中模式

MODE.ONDEMAND  仅显示当前范围

MODE.SELECTION选中时显示

MODE.SNAPSHOT显示所有

Mapview的注意事项

Notice that the MapView inherits directly from
Android's ViewGroup. Therefore, the MapView class inherits all the methods and
properties from the ViewGroup and is very similar to working with other Android
views. To make the MapView functional, it must have at least one Layer as its child. In general, the MapView is the parent of all Layerchildren.

资料

http://blog.csdn.net/arcgis_all/article/details/8233027

【技术直通车】ArcGIS for Android离线数据编辑实现原理

利用ArcGIS
Server REST API实现对Feature的编辑操作

最新文章

  1. 锤子OneStep及BigBang使用体验
  2. Eclipse JUnit 生成报告
  3. 写一个 nodejs npm应用 - webhere
  4. SGU 455 Sequence analysis(Cycle detection,floyd判圈算法)
  5. C++多态的实现与局限性
  6. Direct2D 简介
  7. iOS开发-添加圆角效果高效实现
  8. Windows系统pip安装whl包
  9. .net 第一次请求比较慢
  10. [CF1132G]Greedy Subsequences
  11. Android相机启动crash错误排查
  12. pta总结1
  13. Hacklab综合关
  14. LeetCode 797. All Paths From Source to Target
  15. 记一次nginx强制将https请求重定向http
  16. 【LeetCode】239. Sliding Window Maximum
  17. win 10 安装visual studio 2010
  18. C# 申请非托管内存
  19. day 11 生成器
  20. Java从零开始学五(数据类型转换)

热门文章

  1. shell 实现闰年的判断
  2. 理解SQL查询的底层原理
  3. python3之编码
  4. Jmeter &amp; TICK
  5. 微服务监控之一:Metrics让微服务运行更透明
  6. 批量删除osd的shell脚本
  7. Oracle 静默安装oracle client
  8. js实现大文件分片上传的方法
  9. 10-17C#语句(3)--跳转语句、异常处理语句
  10. vsftp部署和优化错误