Permalink
Browse files

MapViewPosition2 parameter and sample #1044

  • Loading branch information...
devemux86 committed Mar 16, 2018
1 parent cd50e01 commit 70c2778b8a58d50edd8ef561aafcc550ef5303f1
@@ -6,6 +6,7 @@
- MyLocationOverlay implementation [#1035](https://github.com/mapsforge/mapsforge/issues/1035)
- Tile sources with api keys [#1028](https://github.com/mapsforge/mapsforge/issues/1028)
- Render theme fallback internal resources [#1026](https://github.com/mapsforge/mapsforge/issues/1026)
- MapViewPosition interface [#1044](https://github.com/mapsforge/mapsforge/pull/1044)
- JTS (LocationTech) [#1027](https://github.com/mapsforge/mapsforge/issues/1027)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/mapsforge/issues?q=is%3Aclosed+milestone%3A0.10.0)
@@ -16,6 +16,11 @@
public final class Parameters {
/**
* If true the <code>MapViewPosition2</code> will be used instead of default <code>MapViewPosition</code>.
*/
public static boolean MAP_VIEW_POSITION2 = false;
/**
* Maximum buffer size for map files.
*/
@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014 Ludwig M Brinckmann
* Copyright 2018 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -15,14 +16,23 @@
*/
package org.mapsforge.map.model;
import org.mapsforge.core.util.Parameters;
import org.mapsforge.map.model.common.Persistable;
import org.mapsforge.map.model.common.PreferencesFacade;
public class Model implements Persistable {
public final DisplayModel displayModel = new DisplayModel();
public final FrameBufferModel frameBufferModel = new FrameBufferModel();
public final MapViewDimension mapViewDimension = new MapViewDimension();
public final MapViewPosition mapViewPosition = new MapViewPosition(displayModel);
public final IMapViewPosition mapViewPosition;
public Model() {
if (Parameters.MAP_VIEW_POSITION2) {
mapViewPosition = new MapViewPosition2(displayModel);
} else {
mapViewPosition = new MapViewPosition(displayModel);
}
}
@Override
public void init(PreferencesFacade preferencesFacade) {
@@ -126,6 +126,9 @@
<activity
android:name=".LongPressAction"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MapViewPosition2Viewer"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MoveAnimation"
android:configChanges="keyboardHidden|orientation|screenSize" />
@@ -0,0 +1,36 @@
/*
* Copyright 2018 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.mapsforge.samples.android;
import android.os.Bundle;
import org.mapsforge.core.util.Parameters;
public class MapViewPosition2Viewer extends DefaultTheme {
@Override
protected void onCreate(Bundle savedInstanceState) {
Parameters.MAP_VIEW_POSITION2 = true;
super.onCreate(savedInstanceState);
}
@Override
protected void onDestroy() {
super.onDestroy();
Parameters.MAP_VIEW_POSITION2 = false;
}
}
@@ -186,6 +186,7 @@ public void onClick(DialogInterface dialog, int which) {
linearLayout.addView(createButton(HillshadingCompareMapViewer.class));
linearLayout.addView(createButton(ReverseGeocodeViewer.class));
linearLayout.addView(createButton(NightModeViewer.class));
linearLayout.addView(createButton(MapViewPosition2Viewer.class));
linearLayout.addView(createButton(RenderThemeChanger.class));
linearLayout.addView(createButton(TileSizeChanger.class));
linearLayout.addView(createButton(StackedLayersMapViewer.class));

0 comments on commit 70c2778

Please sign in to comment.