X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=public%2Fjs%2Fsyjraw.js;h=59b3f5c4a876eee75c5ef794ac3862827758e6f7;hp=8a77bb0ee948faf92d9495aa8ea27e07e8d7733c;hb=c06c7fd6e6f26d31abb8d7c9a9f9e3f2d5b27d5c;hpb=4022a532856c006efc57fbd8830bde4607c0114d diff --git a/public/js/syjraw.js b/public/js/syjraw.js index 8a77bb0..59b3f5c 100644 --- a/public/js/syjraw.js +++ b/public/js/syjraw.js @@ -1,3 +1,8 @@ +/* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier, + and is published under the AGPL license. */ + +"use strict"; + var WGS84 = new OpenLayers.Projection("EPSG:4326"); var Mercator = new OpenLayers.Projection("EPSG:900913"); @@ -18,7 +23,7 @@ function resizeMap() { } function mapquestLayer() { - return new OpenLayers.Layer.OSM("Mapquest", [ + return new OpenLayers.Layer.OSM("MapQuest", [ 'http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', 'http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', 'http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', @@ -26,8 +31,8 @@ function mapquestLayer() { { attribution: SyjStrings.mapquestAttribution}); } -function osmLayer() { - return new OpenLayers.Layer.OSM("OSM", [ +function mapnikLayer() { + return new OpenLayers.Layer.OSM("Mapnik", [ 'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png', 'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png', 'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'], @@ -36,7 +41,10 @@ function osmLayer() { function init() { var map = new OpenLayers.Map('map', { - controls: [ new OpenLayers.Control.Attribution() ], + controls: [ + new OpenLayers.Control.Navigation(), + new OpenLayers.Control.Attribution() + ], theme: null}), parameters = OpenLayers.Util.getParameters(window.location.href), @@ -52,22 +60,22 @@ function init() { if (parameters.layer) { switch (parameters.layer.toUpperCase()) { - case 'M': + case 'Q': baseLayer = mapquestLayer(); break; - case 'O': - baseLayer = osmLayer(); + case 'M': + baseLayer = mapnikLayer(); break; } } if (!baseLayer) { - baseLayer = osmLayer(); + baseLayer = mapnikLayer(); } map.addLayers([baseLayer, viewLayer]); viewLayer.addFeatures([wkt.read(gInitialGeom.data)]); - extent = viewLayer.getDataExtent(); + var extent = viewLayer.getDataExtent(); map.updateSize(); map.zoomToExtent(extent); resizeMap();