From 0546f974c5f7215cb459269a12e29ed463277771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 25 Feb 2011 13:51:33 +0000 Subject: [PATCH] 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 --- examples/mobile-navigation.js | 43 +++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/examples/mobile-navigation.js b/examples/mobile-navigation.js index 7d69226145..0446426c91 100644 --- a/examples/mobile-navigation.js +++ b/examples/mobile-navigation.js @@ -1,17 +1,30 @@ -var map, layer; +var map; + function init() { - map = new OpenLayers.Map('map', { controls: [ - new OpenLayers.Control.TouchNavigation({ - dragPanOptions: { - interval: 0, // non-zero kills performance on some mobile phones - enableKinetic: true - } - }), - new OpenLayers.Control.ZoomPanel() - ] }); - layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", - "http://vmap0.tiles.osgeo.org/wms/vmap0", - {layers: 'basic'} ); - map.addLayer(layer); - map.setCenter(new OpenLayers.LonLat(5, 40), 2); + 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({ + dragPanOptions: { + interval: 0, // non-zero kills performance on some mobile phones + enableKinetic: true + } + }), + new OpenLayers.Control.ZoomPanel() + ], + layers: [ + new OpenLayers.Layer.OSM("OpenStreetMap", null, { + transitionEffect: 'resize' + }) + ] + }); + map.setCenter(new OpenLayers.LonLat(0, 0), 3); }