diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/config.js-example | 4 | ||||
-rw-r--r-- | www/js/map-OpenStreetMap.js | 46 |
2 files changed, 12 insertions, 38 deletions
diff --git a/www/js/config.js-example b/www/js/config.js-example index 49c2003..c2d3f71 100644 --- a/www/js/config.js-example +++ b/www/js/config.js-example @@ -14,6 +14,10 @@ var CONFIG = { // Leave as null to use the default templates. COBRAND: null, + // Type of map to use; possible options currently are 'OSM', 'Bing' or + // 'FMS' (UK only). The default is OSM. + MAP_TYPE: 'OSM', + // namespace for storing drafts etc in. Should not need to change NAMESPACE: 'fixmystreet', diff --git a/www/js/map-OpenStreetMap.js b/www/js/map-OpenStreetMap.js index 7467653..47ac8f3 100644 --- a/www/js/map-OpenStreetMap.js +++ b/www/js/map-OpenStreetMap.js @@ -1,13 +1,11 @@ function set_map_config(perm) { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } fixmystreet.controls = [ + new OpenLayers.Control.Attribution(), new OpenLayers.Control.ArgParser(), - //new OpenLayers.Control.Navigation(), + new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; + fixmystreet.map_type = OpenLayers.Layer.OSM.Mapnik; } // http://www.openstreetmap.org/openlayers/OpenStreetMap.js (added maxResolution) @@ -58,13 +56,13 @@ OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, { */ initialize: function(name, options) { var url = [ - "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" + "https://a.tile.openstreetmap.org/${z}/${x}/${y}.png", + "https://b.tile.openstreetmap.org/${z}/${x}/${y}.png", + "https://c.tile.openstreetmap.org/${z}/${x}/${y}.png" ]; options = OpenLayers.Util.extend({ /* Below line added to OSM's file in order to allow minimum zoom level */ - maxResolution: 156543.0339/Math.pow(2, options.zoomOffset || 0), + maxResolution: 156543.03390625/Math.pow(2, options.zoomOffset || 0), numZoomLevels: 19, buffer: 0 }, options); @@ -76,34 +74,6 @@ OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, { }); /** - * Class: OpenLayers.Layer.OSM.Osmarender - * - * Inherits from: - * - <OpenLayers.Layer.OSM> - */ -OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, { - /** - * Constructor: OpenLayers.Layer.OSM.Osmarender - * - * Parameters: - * name - {String} - * options - {Object} Hashtable of extra options to tag onto the layer - */ - initialize: function(name, options) { - var url = [ - "http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png", - "http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png", - "http://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png" - ]; - options = OpenLayers.Util.extend({ numZoomLevels: 18, buffer: 0 }, options); - var newArguments = [name, url, options]; - OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); - }, - - CLASS_NAME: "OpenLayers.Layer.OSM.Osmarender" -}); - -/** * Class: OpenLayers.Layer.OSM.CycleMap * * Inherits from: @@ -125,7 +95,7 @@ OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, { ]; options = OpenLayers.Util.extend({ /* Below line added to OSM's file in order to allow minimum zoom level */ - maxResolution: 156543.0339/Math.pow(2, options.zoomOffset || 0), + maxResolution: 156543.03390625/Math.pow(2, options.zoomOffset || 0), numZoomLevels: 19, buffer: 0 }, options); |