지도/로컬 API에 대한 문의게시판입니다.
현재 사진과 같이 커스텀마커가 제대로 동작되지 않는 상황이 가끔 발생하고있습니다.
MapPOIItem customMarker = new MapPOIItem();
customMarker.setMarkerType(MapPOIItem.MarkerType.CustomImage); // 마커타입을 커스텀 마커로 지정.
customMarker.setCustomImageResourceId(R.drawable.map_marker); // 마커 이미지.
customMarker.setCustomImageAutoscale(false); // hdpi, xhdpi 등 안드로이드 플랫폼의 스케일을 사용할 경우 지도 라이브러리의 스케일 기능을 꺼줌.
customMarker.setCustomImageAnchor(0.5f, 1.0f); // 마커 이미지중 기준이 되는 위치(앵커포인트) 지정 - 마커 이미지 좌측 상단 기준 x(0.0f ~ 1.0f), y(0.0f ~ 1.0f) 값.
String x = data.get(i).getAddress_x();
String y = data.get(i).getAddress_y();
customMarker.setItemName(data.get(i).getTitle());
customMarker.setTag(i);
try {
customMarker.setMapPoint(MapPoint.mapPointWithGeoCoord(Double.parseDouble(x), Double.parseDouble(y)));
} catch (Exception e) {
GPSUtil gpsUtil = new GPSUtil(getContext());
Double latitude = gpsUtil.getLatitude();
Double longitude = gpsUtil.getLongitude();
customMarker.setMapPoint(MapPoint.mapPointWithGeoCoord(latitude, longitude));
}
mapView.addPOIItem(customMarker);
mapView.selectPOIItem(customMarker, true);
해당 코드 첨부하였습니다