Search in sources :

Example 1 with MarkerCallout

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();
            }
        }
    });
}
Also used : MarkerCallout(com.peterlaurence.trekadvisor.menu.mapview.components.MarkerCallout) MarkerLayout(com.qozix.tileview.markers.MarkerLayout) MovableMarker(com.peterlaurence.trekadvisor.menu.mapview.components.MovableMarker) TileView(com.qozix.tileview.TileView) View(android.view.View) MovableMarker(com.peterlaurence.trekadvisor.menu.mapview.components.MovableMarker)

Aggregations

View (android.view.View)1 MarkerCallout (com.peterlaurence.trekadvisor.menu.mapview.components.MarkerCallout)1 MovableMarker (com.peterlaurence.trekadvisor.menu.mapview.components.MovableMarker)1 TileView (com.qozix.tileview.TileView)1 MarkerLayout (com.qozix.tileview.markers.MarkerLayout)1