use of com.peterlaurence.trekadvisor.menu.mapview.components.MarkerCallout in project TrekAdvisor by peterLaurence.
the class MarkerLayer method setTileView.
private void setTileView(final TileView tileView) {
mTileView = tileView;
mTileView.setMarkerTapListener(new MarkerLayout.MarkerTapListener() {
@Override
public void onMarkerTap(View view, int x, int y) {
if (view instanceof MovableMarker) {
MovableMarker movableMarker = (MovableMarker) view;
/* Prepare the callout */
MarkerCallout markerCallout = new MarkerCallout(mContext);
markerCallout.setMoveAction(new MorphMarkerRunnable(movableMarker, markerCallout, mTileView, mContext, mMap));
markerCallout.setEditAction(new EditMarkerRunnable(movableMarker, MarkerLayer.this, markerCallout, mTileView, mRequestManageMarkerListener));
markerCallout.setDeleteAction(new DeleteMarkerRunnable(mParentView, movableMarker, markerCallout, tileView, mMap));
MarkerGson.Marker marker = movableMarker.getMarker();
markerCallout.setTitle(marker.name);
markerCallout.setSubTitle(marker.lat, marker.lon);
mTileView.addCallout(markerCallout, movableMarker.getRelativeX(), movableMarker.getRelativeY(), -0.5f, -1.2f);
markerCallout.transitionIn();
}
}
});
}
Aggregations