android ArcGIS学习笔记一
2012-09-08 18:18
218 查看
动态操作地图服务
1.动态添加一个地图服务
String url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer";
ArcGISDynamicMapServiceLayer arcGISDynamicMapServiceLayer=new ArcGISDynamicMapServiceLayer(HelloWorld.this,HelloWorld.this.url);
map.addLayer(arcGISDynamicMapServiceLayer);
2.移除地图服务
map.removeLayer();
reorderLayer();
导航与触屏操作
1.放大
map.zoomin();
2.缩小
map.zoomout();
3.取得当前长按位置坐标
this.map.setOnLongPressListener(new OnLongPressListener(){
@Override
public void onLongPress(float x, float y) {
Point point=HelloWorld.this.map.toMapPoint(x,y);
showStation.setText("X:"+point.getX()+"Y:"+point.getY());
}
});
4.mapView的事件
OnLongPressListener 在MapView 上长按时
OnMapExtentChangedListener MapView 的地图范围改变时
OnPanListener 在MapView 中拖劢地图时
OnPinchListener 在MapView 上两指缩放操作时
OnSingleTapListener 在MapView 上单击时
OnStatusChangedListener 在MapView 的状态改变,比如被创建戒刜始化时
OnZoomListener 在MapView 被缩放时
MapOnTouchListener 在MapView 上按住并移劢(类似绘图操作)时
用户要素
1.添加用户要素
graphicsLayer=(GraphicsLayer) findViewById(R.id.glayer);
graphicsLayer.setRenderer(new SimpleRenderer(new SimpleMarkerSymbol(Color.RED,20,STYLE.SQUARE)));
Graphic graphic=new Graphic();
graphic.setGeometry(HelloWorld.this.map.getCenter());
graphicsLayer.addGraphic(graphic);
graphicsLayer.postInvalidate();
2.添加用户要素使用指定图片
Drawable drawable=this.getBaseContext().getResources().getDrawable(R.drawable.icon);
graphicsLayer.setRenderer(new SimpleRenderer(new PictureMarkerSymbol(drawable)));
Graphic graphic=new Graphic();
graphic.setGeometry(HelloWorld.this.map.getCenter());
graphicsLayer.addGraphic(graphic);
graphicsLayer.postInvalidate();
3.分类渲染或是唯一值渲染
graphicsLayer=(GraphicsLayer) findViewById(R.id.glayer);
//分类渲染或是唯一值渲染
ClassBreaksRenderer breaksRenderer=new ClassBreaksRenderer();
breaksRenderer.setField("class");
breaksRenderer.setMinValue(0);
ClassBreak cb1=new ClassBreak();
cb1.setClassMaxValue(0.5);
cb1.setSymbol(new SimpleMarkerSymbol(Color.RED,20,SimpleMarkerSymbol.STYLE.CIRCLE));
breaksRenderer.addClassBreak(cb1);
ClassBreak cb2=new ClassBreak();
cb1.setClassMaxValue(1);
cb1.setSymbol(new SimpleMarkerSymbol(Color.GREEN,20,SimpleMarkerSymbol.STYLE.CIRCLE));
breaksRenderer.addClassBreak(cb2);
graphicsLayer.setRenderer(breaksRenderer);
//添加用户要素
Graphic graphic=new Graphic();
//分类渲染或是唯一值渲染时使用
graphic.setAttributeValue("class", Math.random());
graphic.setGeometry(HelloWorld.this.map.getCenter());
graphicsLayer.addGraphic(graphic);
graphicsLayer.postInvalidate();
通过交互绘制几何图相
查询与实别
1.动态添加一个地图服务
String url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer";
ArcGISDynamicMapServiceLayer arcGISDynamicMapServiceLayer=new ArcGISDynamicMapServiceLayer(HelloWorld.this,HelloWorld.this.url);
map.addLayer(arcGISDynamicMapServiceLayer);
2.移除地图服务
map.removeLayer();
reorderLayer();
导航与触屏操作
1.放大
map.zoomin();
2.缩小
map.zoomout();
3.取得当前长按位置坐标
this.map.setOnLongPressListener(new OnLongPressListener(){
@Override
public void onLongPress(float x, float y) {
Point point=HelloWorld.this.map.toMapPoint(x,y);
showStation.setText("X:"+point.getX()+"Y:"+point.getY());
}
});
4.mapView的事件
OnLongPressListener 在MapView 上长按时
OnMapExtentChangedListener MapView 的地图范围改变时
OnPanListener 在MapView 中拖劢地图时
OnPinchListener 在MapView 上两指缩放操作时
OnSingleTapListener 在MapView 上单击时
OnStatusChangedListener 在MapView 的状态改变,比如被创建戒刜始化时
OnZoomListener 在MapView 被缩放时
MapOnTouchListener 在MapView 上按住并移劢(类似绘图操作)时
用户要素
1.添加用户要素
graphicsLayer=(GraphicsLayer) findViewById(R.id.glayer);
graphicsLayer.setRenderer(new SimpleRenderer(new SimpleMarkerSymbol(Color.RED,20,STYLE.SQUARE)));
Graphic graphic=new Graphic();
graphic.setGeometry(HelloWorld.this.map.getCenter());
graphicsLayer.addGraphic(graphic);
graphicsLayer.postInvalidate();
2.添加用户要素使用指定图片
Drawable drawable=this.getBaseContext().getResources().getDrawable(R.drawable.icon);
graphicsLayer.setRenderer(new SimpleRenderer(new PictureMarkerSymbol(drawable)));
Graphic graphic=new Graphic();
graphic.setGeometry(HelloWorld.this.map.getCenter());
graphicsLayer.addGraphic(graphic);
graphicsLayer.postInvalidate();
3.分类渲染或是唯一值渲染
graphicsLayer=(GraphicsLayer) findViewById(R.id.glayer);
//分类渲染或是唯一值渲染
ClassBreaksRenderer breaksRenderer=new ClassBreaksRenderer();
breaksRenderer.setField("class");
breaksRenderer.setMinValue(0);
ClassBreak cb1=new ClassBreak();
cb1.setClassMaxValue(0.5);
cb1.setSymbol(new SimpleMarkerSymbol(Color.RED,20,SimpleMarkerSymbol.STYLE.CIRCLE));
breaksRenderer.addClassBreak(cb1);
ClassBreak cb2=new ClassBreak();
cb1.setClassMaxValue(1);
cb1.setSymbol(new SimpleMarkerSymbol(Color.GREEN,20,SimpleMarkerSymbol.STYLE.CIRCLE));
breaksRenderer.addClassBreak(cb2);
graphicsLayer.setRenderer(breaksRenderer);
//添加用户要素
Graphic graphic=new Graphic();
//分类渲染或是唯一值渲染时使用
graphic.setAttributeValue("class", Math.random());
graphic.setGeometry(HelloWorld.this.map.getCenter());
graphicsLayer.addGraphic(graphic);
graphicsLayer.postInvalidate();
通过交互绘制几何图相
查询与实别
相关文章推荐
- android ArcGIS学习笔记一
- android ArcGIS学习笔记
- ArcGIS runtime SDK for android的学习笔记(序:写在开始之前的话)
- 学习ArcGis for Android一些类图关系笔记
- Android下开发ArcGIS系统学习笔记--(hdpi/mdpi/ldpi区别)
- 关于Android SQLite3多线程并发问题,学习笔记。
- android training 学习笔记002-Android分享操作
- Android(OPhone) 学习笔记1 - 搜索API的使用
- Android(java)学习笔记221:开发一个多界面的应用程序之不同界面间互相传递数据(短信助手案例)
- Android2.1消息应用(Messaging)源码学习笔记
- Android官网学习笔记002:应用程序基本原理(01)
- Android开发秘籍学习笔记(四)
- Android中级学习笔记(三)之eclipse建完aidl文件后gen中没有生成相应的Java文件
- Android Activity和Intent机制学习笔记
- Java 当中的线程(一)-- MarsChen Java4Android 教程学习笔记
- 广播机制 -- MarsChen Android 开发教程学习笔记
- android Handler 机制研究学习笔记
- android Fragment 学习笔记
- Android表格布局TableLayout学习笔记
- android官网文档学习笔记