start: add tilegridlayer to menu
This commit is contained in:
parent
4ddf9dcf39
commit
c0369236d2
@ -27,4 +27,11 @@
|
|||||||
</item>
|
</item>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/gridlayer"
|
||||||
|
android:showAsAction="never"
|
||||||
|
android:checkable="true"
|
||||||
|
android:title="@string/menu_gridlayer">
|
||||||
|
</item>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -15,5 +15,6 @@
|
|||||||
<string name="styler_mode_area">Area</string>
|
<string name="styler_mode_area">Area</string>
|
||||||
<string name="styler_mode_outline">Outline</string>
|
<string name="styler_mode_outline">Outline</string>
|
||||||
<string name="styler_controls_toggle">Controls</string>
|
<string name="styler_controls_toggle">Controls</string>
|
||||||
|
<string name="menu_gridlayer">Gridlayer</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -20,6 +20,7 @@ import org.oscim.android.MapActivity;
|
|||||||
import org.oscim.android.MapView;
|
import org.oscim.android.MapView;
|
||||||
import org.oscim.android.cache.TileCache;
|
import org.oscim.android.cache.TileCache;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
|
import org.oscim.layers.TileGridLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
@ -36,6 +37,7 @@ public class BaseMapActivity extends MapActivity {
|
|||||||
MapView mMapView;
|
MapView mMapView;
|
||||||
VectorTileLayer mBaseLayer;
|
VectorTileLayer mBaseLayer;
|
||||||
TileSource mTileSource;
|
TileSource mTileSource;
|
||||||
|
TileGridLayer mGridLayer;
|
||||||
|
|
||||||
private TileCache mCache;
|
private TileCache mCache;
|
||||||
|
|
||||||
@ -105,6 +107,20 @@ public class BaseMapActivity extends MapActivity {
|
|||||||
mMap.setTheme(VtmThemes.NEWTRON);
|
mMap.setTheme(VtmThemes.NEWTRON);
|
||||||
item.setChecked(true);
|
item.setChecked(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case R.id.gridlayer:
|
||||||
|
if (item.isChecked()) {
|
||||||
|
item.setChecked(false);
|
||||||
|
mMap.layers().remove(mGridLayer);
|
||||||
|
} else {
|
||||||
|
item.setChecked(true);
|
||||||
|
if (mGridLayer == null)
|
||||||
|
mGridLayer = new TileGridLayer(mMap);
|
||||||
|
|
||||||
|
mMap.layers().add(mGridLayer);
|
||||||
|
}
|
||||||
|
mMap.updateMap(true);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user