Samples improvements
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018 devemux86
|
* Copyright 2018-2019 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* 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
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -35,13 +35,12 @@ import java.io.File;
|
|||||||
/**
|
/**
|
||||||
* A very basic Android app example.
|
* A very basic Android app example.
|
||||||
* <p>
|
* <p>
|
||||||
* You'll need a map with filename germany.map from download.mapsforge.org in device storage.
|
* You'll need a map with filename berlin.map from download.mapsforge.org in device storage.
|
||||||
* Can be berlin.map renamed as germany.map because of smaller size.
|
|
||||||
*/
|
*/
|
||||||
public class GettingStarted extends Activity {
|
public class GettingStarted extends Activity {
|
||||||
|
|
||||||
// Name of the map file in device storage
|
// Name of the map file in device storage
|
||||||
private static final String MAP_FILE = "germany.map";
|
private static final String MAP_FILE = "berlin.map";
|
||||||
|
|
||||||
private MapView mapView;
|
private MapView mapView;
|
||||||
private MapScaleBar mapScaleBar;
|
private MapScaleBar mapScaleBar;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2019 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -19,6 +19,7 @@ package org.oscim.app;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Environment;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
import org.oscim.android.cache.TileCache;
|
import org.oscim.android.cache.TileCache;
|
||||||
@@ -41,6 +42,8 @@ import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class MapLayers {
|
public class MapLayers {
|
||||||
|
|
||||||
static final Logger log = LoggerFactory.getLogger(MapLayers.class);
|
static final Logger log = LoggerFactory.getLogger(MapLayers.class);
|
||||||
@@ -64,7 +67,7 @@ public class MapLayers {
|
|||||||
@Override
|
@Override
|
||||||
TileSource init() {
|
TileSource init() {
|
||||||
return new MapFileTileSource().setOption("file",
|
return new MapFileTileSource().setOption("file",
|
||||||
"/storage/sdcard0/germany.map");
|
new File(Environment.getExternalStorageDirectory(), "berlin.map").getAbsolutePath());
|
||||||
}
|
}
|
||||||
}, new Config("MAPNIK_VECTOR") {
|
}, new Config("MAPNIK_VECTOR") {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user