@Override
public void onMarkerClick() {
MovableMarker movableMarker = mMovableMarkerWeakReference.get();
if (movableMarker != null) {
movableMarker.morphToStaticForm();
/* After the morph, remove the MarkerGrab */
final MarkerGrab markerGrab = mMarkerGrabWeakReference.get();
markerGrab.morphOut(new Animatable2.AnimationCallback() {
@Override
public void onAnimationEnd(Drawable drawable) {
super.onAnimationEnd(drawable);
if (markerGrab != null) {
mTileView.removeMarker(markerGrab);
}
}
});
/* The view has been moved, update the associated model object */
MarkerGson.Marker marker = movableMarker.getMarker();
if (mMap.getProjection() == null) {
marker.lon = movableMarker.getRelativeX();
marker.lat = movableMarker.getRelativeY();
} else {
marker.proj_x = movableMarker.getRelativeX();
marker.proj_y = movableMarker.getRelativeY();
double[] wgs84Coords;
wgs84Coords = mMap.getProjection().undoProjection(marker.proj_x, marker.proj_y);
if (wgs84Coords != null) {
marker.lon = wgs84Coords[0];
marker.lat = wgs84Coords[1];
}
}
/* Save the changes on the markers.json file */
MapLoader.getInstance().saveMarkers(mMap);
}
}
MarkerLayer.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:TrekAdvisor
作者:
评论列表
文章目录