android-example: add BitmapTileLayer
This commit is contained in:
parent
350f6394fd
commit
0b9e81a6c0
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="10"
|
android:minSdkVersion="10"
|
||||||
android:targetSdkVersion="18" />
|
android:targetSdkVersion="10" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@ -30,17 +30,26 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.oscim.android.test.SimpleMapActivity"
|
android:name="org.oscim.android.test.SimpleMapActivity"
|
||||||
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||||
android:label="@string/title_activity_map" >
|
android:label="@string/title_activity_map" >
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.oscim.android.test.PathOverlayActivity"
|
android:name="org.oscim.android.test.PathOverlayActivity"
|
||||||
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||||
android:label="@string/title_activity_map" >
|
android:label="@string/title_activity_map" >
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.oscim.android.test.MarkerOverlayActivity"
|
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" >
|
android:label="@string/title_activity_map" >
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
@ -24,6 +24,8 @@ import org.oscim.android.MapView;
|
|||||||
import org.oscim.backend.canvas.Color;
|
import org.oscim.backend.canvas.Color;
|
||||||
import org.oscim.core.GeoPoint;
|
import org.oscim.core.GeoPoint;
|
||||||
import org.oscim.layers.PathLayer;
|
import org.oscim.layers.PathLayer;
|
||||||
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
|
import org.oscim.layers.tile.bitmap.StamenTonerTiles;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
@ -39,6 +41,8 @@ public class PathOverlayActivity extends MapActivity {
|
|||||||
mMapView = (MapView) findViewById(R.id.mapView);
|
mMapView = (MapView) findViewById(R.id.mapView);
|
||||||
registerMapView(mMapView);
|
registerMapView(mMapView);
|
||||||
|
|
||||||
|
mMap.getLayers().add(new BitmapTileLayer(mMap, StamenTonerTiles.INSTANCE, 20));
|
||||||
|
|
||||||
for (double lon = -180; lon < 180; lon += 5) {
|
for (double lon = -180; lon < 180; lon += 5) {
|
||||||
List<GeoPoint> pts = new ArrayList<GeoPoint>();
|
List<GeoPoint> pts = new ArrayList<GeoPoint>();
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ public class Samples extends Activity {
|
|||||||
setContentView(R.layout.activity_samples);
|
setContentView(R.layout.activity_samples);
|
||||||
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.samples);
|
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.samples);
|
||||||
linearLayout.addView(createButton(SimpleMapActivity.class));
|
linearLayout.addView(createButton(SimpleMapActivity.class));
|
||||||
|
linearLayout.addView(createButton(BitmapTileMapActivity.class));
|
||||||
linearLayout.addView(createButton(PathOverlayActivity.class));
|
linearLayout.addView(createButton(PathOverlayActivity.class));
|
||||||
linearLayout.addView(createButton(MarkerOverlayActivity.class));
|
linearLayout.addView(createButton(MarkerOverlayActivity.class));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user