마커 포인트 길게 누르기

1304 단어
	@Override
		public void OnLongPress(int x, int y) {

			eMyTrackingLayer tl = GetMap().TrackingLayer();
			eMyGeoEvent ge = tl.GetAt("P1");
			if (ge == null) {
				//  Tag P1 , 
				eMyGeometry geom = new eMyGeometry(1, 1);
				eMyPoint mapPoint = GetMap().DrawParam().DevToMap(x, y);
				System.out.println(mapPoint.GetX() + "--" + mapPoint.GetY());
				geom.SetPointAt(0, mapPoint);
				mapPoint.Dispose();

				//  TrackingLayer 
				tl.GetStyle().SetBrushColor(Color.BLUE);
				tl.GetStyle().SetAlpha(128);
				tl.GetStyle().SetPenColor(Color.RED);
				//  
				tl.GetStyle().SetBmpIndex(84);

				String tag = "P1";
				tl.AddEvent(geom, eGeometryType.Point, tag, 0);
				tl.SetVisible(true);
				repaint(0, 0);
			} else {
				//  , 
				eMyPoint devPoint = new eMyPoint(x, y);
				eMyPoint2D geoPoint = DevToGeo(devPoint);
				System.out.println(" :" + geoPoint.GetX() + "--"
						+ geoPoint.GetY());
				ge.MoveTo(geoPoint.GetX(), geoPoint.GetY(), GetMap());
				geoPoint.Dispose();
				tl.SetVisible(true);
				repaint(0, 0);
			}
		}

좋은 웹페이지 즐겨찾기