html: set start position in mapconfig
This commit is contained in:
parent
cedb269e15
commit
e3dccea307
@ -4,6 +4,7 @@ package org.oscim.gdx.client;
|
|||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.backend.GL20;
|
import org.oscim.backend.GL20;
|
||||||
import org.oscim.backend.GLAdapter;
|
import org.oscim.backend.GLAdapter;
|
||||||
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.gdx.GdxMap;
|
import org.oscim.gdx.GdxMap;
|
||||||
import org.oscim.tilesource.TileSource;
|
import org.oscim.tilesource.TileSource;
|
||||||
@ -68,6 +69,15 @@ public class GwtLauncher extends GwtApplication {
|
|||||||
//Gdx.app.setLogLevel(Application.LOG_DEBUG);
|
//Gdx.app.setLogLevel(Application.LOG_DEBUG);
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
|
|
||||||
|
double lat = Double.parseDouble(getMapConfig("latitude"));
|
||||||
|
double lon = Double.parseDouble(getMapConfig("longitude"));
|
||||||
|
int zoom = Integer.parseInt(getMapConfig("zoom"));
|
||||||
|
|
||||||
|
MapPosition p = new MapPosition();
|
||||||
|
p.setZoomLevel(zoom);
|
||||||
|
p.setPosition(lat, lon);
|
||||||
|
mMapView.setMapPosition(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,8 +24,11 @@ canvas {
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var mapconfig = {
|
var mapconfig = {
|
||||||
tilesource : "oscimap2",
|
tilesource : "oscimap4",
|
||||||
tileurl : "/tiles"
|
tileurl : "/osci/testing2",
|
||||||
|
zoom: "4",
|
||||||
|
latitude: "0.0",
|
||||||
|
longitude: "0.0"
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -46,7 +49,7 @@ canvas {
|
|||||||
function handleMouseDown(evt) {
|
function handleMouseDown(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
evt.target.style.cursor = 'move';
|
evt.target.style.cursor = 'default';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseUp(evt) {
|
function handleMouseUp(evt) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user