make the mobile-navigation example use an OSM layer, example only change

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11499 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2011-02-25 13:51:33 +00:00
parent 1179ffe682
commit 0546f974c5
+21 -8
View File
@@ -1,6 +1,17 @@
var map, layer; var map;
function init() { function init() {
map = new OpenLayers.Map('map', { controls: [ map = new OpenLayers.Map({
div: "map",
theme: null,
projection: new OpenLayers.Projection("EPSG:900913"),
units: "m",
numZoomLevels: 18,
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(
-20037508.34, -20037508.34, 20037508.34, 20037508.34
),
controls: [
new OpenLayers.Control.TouchNavigation({ new OpenLayers.Control.TouchNavigation({
dragPanOptions: { dragPanOptions: {
interval: 0, // non-zero kills performance on some mobile phones interval: 0, // non-zero kills performance on some mobile phones
@@ -8,10 +19,12 @@ function init() {
} }
}), }),
new OpenLayers.Control.ZoomPanel() new OpenLayers.Control.ZoomPanel()
] }); ],
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", layers: [
"http://vmap0.tiles.osgeo.org/wms/vmap0", new OpenLayers.Layer.OSM("OpenStreetMap", null, {
{layers: 'basic'} ); transitionEffect: 'resize'
map.addLayer(layer); })
map.setCenter(new OpenLayers.LonLat(5, 40), 2); ]
});
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
} }