android-example: add BitmapTileLayer

This commit is contained in:
Hannes Janetzek 2014-01-19 22:40:27 +01:00
parent 350f6394fd
commit 0b9e81a6c0
4 changed files with 52 additions and 1 deletions

View File

@ -10,7 +10,7 @@
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
android:targetSdkVersion="10" />
<application
android:allowBackup="true"
@ -30,17 +30,26 @@
<activity
android:name="org.oscim.android.test.SimpleMapActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:label="@string/title_activity_map" >
</activity>
<activity
android:name="org.oscim.android.test.PathOverlayActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:label="@string/title_activity_map" >
</activity>
<activity
android:name="org.oscim.android.test.MarkerOverlayActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:label="@string/title_activity_map" >
</activity>
<activity
android:name="org.oscim.android.test.BitmapTileMapActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:label="@string/title_activity_map" >
</activity>
</application>

View File

@ -0,0 +1,37 @@
/*
* Copyright 2014 Hannes Janetzek
*
* 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.MapActivity;
import org.oscim.android.MapView;
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
import org.oscim.layers.tile.bitmap.StamenTonerTiles;
import android.os.Bundle;
public class BitmapTileMapActivity extends MapActivity {
MapView mMapView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
mMapView = (MapView) findViewById(R.id.mapView);
//registerMapView(mMapView);
mMap.getLayers().add(new BitmapTileLayer(mMap, StamenTonerTiles.INSTANCE, 20));
}
}

View File

@ -24,6 +24,8 @@ import org.oscim.android.MapView;
import org.oscim.backend.canvas.Color;
import org.oscim.core.GeoPoint;
import org.oscim.layers.PathLayer;
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
import org.oscim.layers.tile.bitmap.StamenTonerTiles;
import android.os.Bundle;
@ -39,6 +41,8 @@ public class PathOverlayActivity extends MapActivity {
mMapView = (MapView) findViewById(R.id.mapView);
registerMapView(mMapView);
mMap.getLayers().add(new BitmapTileLayer(mMap, StamenTonerTiles.INSTANCE, 20));
for (double lon = -180; lon < 180; lon += 5) {
List<GeoPoint> pts = new ArrayList<GeoPoint>();

View File

@ -36,6 +36,7 @@ public class Samples extends Activity {
setContentView(R.layout.activity_samples);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.samples);
linearLayout.addView(createButton(SimpleMapActivity.class));
linearLayout.addView(createButton(BitmapTileMapActivity.class));
linearLayout.addView(createButton(PathOverlayActivity.class));
linearLayout.addView(createButton(MarkerOverlayActivity.class));
}