본문 바로가기

Android

[Tmap] 지도에 마커 띄우기

TMapMarkerItem tourMarkerItem = new TMapMarkerItem();
TMapPoint tpoint = new TMapPoint(mapY, mapX);
tourMarkerItem.setTMapPoint(tpoint);
tourMarkerItem.setVisible(TMapMarkerItem.VISIBLE);
tourMarkerItem.setIcon(tourBitmap);

mMapView.setCenterPoint(mapX,mapY , false);
mMapView.addMarkerItem("tourMarker", tourMarkerItem);

1. TMapMarkerItem 객체를 생성한다.

2. TMapPoint 객체를 생성하고 좌표를 등록한다. ( point를 생성할때 (y,x) 순으로 매개변수를 받는다. 이것때문에 헷갈려서 헤맴)

3. 마커에 point를 지정한다.

4. 마커의 VISIBLE을 설정한다 (TMapMarkerItem.VISIBLE은 int값 1과 같음)

5. 마커의 이미지를 설정한다.

6. 맵의 중심이 마커로 이동

7. 맵에 마커표시


* 왜 다른 생성자는 x,y 순으로 받는데 TMapPoint만 y,x순으로 받냐? 헷갈리게!!