Search in sources :

Example 1 with MapPosition

use of org.mapsforge.core.model.MapPosition in project RSAndroidApp by RailwayStations.

the class MapsActivity method onPause.

@Override
protected void onPause() {
    if (this.layer instanceof TileDownloadLayer) {
        ((TileDownloadLayer) this.layer).onPause();
    }
    unregisterLocationManager();
    final MapPosition mapPosition = binding.map.mapView.getModel().mapViewPosition.getMapPosition();
    baseApplication.setLastMapPosition(mapPosition);
    destroyClusterManager();
    super.onPause();
}
Also used : TileDownloadLayer(org.mapsforge.map.layer.download.TileDownloadLayer) MapPosition(org.mapsforge.core.model.MapPosition)

Example 2 with MapPosition

use of org.mapsforge.core.model.MapPosition in project RSAndroidApp by RailwayStations.

the class MapsActivity method initializePosition.

/**
 * initializes the map view position.
 *
 * @param mvp the map view position to be set
 */
protected void initializePosition(final IMapViewPosition mvp) {
    if (myPos != null) {
        mvp.setMapPosition(new MapPosition(myPos, baseApplication.getZoomLevelDefault()));
    } else {
        mvp.setMapPosition(baseApplication.getLastMapPosition());
    }
    mvp.setZoomLevelMax(getZoomLevelMax());
    mvp.setZoomLevelMin(getZoomLevelMin());
}
Also used : MapPosition(org.mapsforge.core.model.MapPosition)

Aggregations

MapPosition (org.mapsforge.core.model.MapPosition)2 TileDownloadLayer (org.mapsforge.map.layer.download.TileDownloadLayer)1