/** * 地图单击:要素识别 */ final Button identify = (Button) findViewById(R.id.identify); identify.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { coordinate = (TextView) findViewById(R.id.coordinate); parent.removeView(coordinate); map.addLayer(new ArcGISTiledMapServiceLayer ("http://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Diversity_Index/MapServer")); map.setOnSingleTapListener(new OnSingleTapListener() { @Override public void onSingleTap(float x, float y) { Point p = map.toMapPoint(x, y); IdentifyParameters identifyParameters = new IdentifyParameters(); identifyParameters.setLayers(new int[] { 4}); identifyParameters.setLayerMode(IdentifyParameters.ALL_LAYERS); id
要素识别
最新推荐文章于 2022-04-29 11:00:00 发布
该代码段展示了如何在Android应用中实现在地图上单击时进行要素识别的功能。通过监听地图单击事件,获取点击位置并设置识别参数,执行ArcGIS的IdentifyTask来获取相关信息,包括地方名称、州缩写、总人口和土地面积,并将结果显示在Callout中。
摘要由CSDN通过智能技术生成