/** * 绘制点线面:点击“添加额外服务”后,地图放大缩小拖拽等功能失效 */ add_gService = (Button) findViewById(R.id.add_gservice); add_gService.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { gLayer = new GraphicsLayer(); map.addLayer(gLayer); map.setOnTouchListener(new View.OnTouchListener() { Point previous = null; Polygon polygon = null; @Override public boolean onTouch(View v, MotionEvent event) { float x = event.getX(); float y = event.getY(); Point currPoint = map.toMapPoint(x, y); if (isChoose == true) { previous = null; polygon = null; } if (type == Geometry.Type.POINT) { Graphic graphic = new Graphic(currPoint, symbol); gLayer.addGraphic(graphic); } else { if (previous == null) { previous = currPoint; Graphic graphic = new Graphic(previous, new SimpleMarkerSymbol(Color.RED, 7,
地图标绘(点线面)
最新推荐文章于 2022-09-30 11:17:26 发布