Samples: various improvements, #32

This commit is contained in:
Emux 2016-07-03 23:40:05 +03:00
parent 6b69c9cf94
commit 7a1d56d888
5 changed files with 61 additions and 10 deletions

View File

@ -1,3 +1,19 @@
/*
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* 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.oscim.android.test;
import java.io.IOException;
@ -62,12 +78,10 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
}
});
mMap.setTheme(VtmThemes.DEFAULT);
mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
mMap.setTheme(VtmThemes.TRONRENDER);
//mMap.setMapPosition(49.417, 8.673, 1 << 17);
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
// mMap.layers().add(new TileGridLayer(mMap));
// String file = Environment.getExternalStorageDirectory().getAbsolutePath();
@ -152,4 +166,13 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
protected void onStop() {
super.onStop();
}
@Override
protected void onResume() {
super.onResume();
/* ignore saved position */
//mMap.setMapPosition(49.417, 8.673, 1 << 17);
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
}
}

View File

@ -1,5 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@ -89,9 +90,9 @@ public class MarkerOverlayActivity extends BitmapTileMapActivity
@Override
protected void onResume() {
super.onResume();
/* ignore saved position */
mMap.setMapPosition(0, 0, 1 << 2);
mMapView.onResume();
}
@Override

View File

@ -1,5 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@ -16,6 +17,8 @@
*/
package org.oscim.android.test;
import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER;
import java.util.ArrayList;
import org.oscim.backend.canvas.Color;
@ -33,8 +36,7 @@ import android.os.Bundle;
public class PathOverlayActivity extends BitmapTileMapActivity {
public PathOverlayActivity() {
//super(STAMEN_TONER.build());
super(null);
super(STAMEN_TONER.build());
}
@Override
@ -67,9 +69,9 @@ public class PathOverlayActivity extends BitmapTileMapActivity {
@Override
protected void onResume() {
super.onResume();
/* ignore saved position */
mMap.setMapPosition(0, 0, 1 << 2);
mMapView.onResume();
}
ArrayList<PathLayer> mPathLayers = new ArrayList<PathLayer>();

View File

@ -1,3 +1,19 @@
/*
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* 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.oscim.android.test;
import org.oscim.android.cache.TileCache;
@ -44,4 +60,11 @@ public class S3DBMapActivity extends BaseMapActivity {
mS3dbCache.dispose();
}
@Override
protected void onResume() {
super.onResume();
/* ignore saved position */
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
}
}

View File

@ -1,5 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@ -13,7 +14,8 @@
*
* 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.oscim.android.test;
*/
package org.oscim.android.test;
import org.oscim.backend.canvas.Color;
import org.oscim.layers.TileGridLayer;
@ -31,7 +33,7 @@ public class VectorLayerMapActivity extends BaseMapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mMap.setTheme(VtmThemes.NEWTRON);
mMap.setTheme(VtmThemes.DEFAULT);
VectorLayer vectorLayer = new VectorLayer(mMap);