aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-tilma-ol.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@fury.ukcod.org.uk>2011-03-09 22:21:04 +0000
committerMatthew Somerville <matthew@fury.ukcod.org.uk>2011-03-09 22:21:04 +0000
commitc56f704e998b418aa3f11d5e3b6b86d6c7ce40e6 (patch)
tree4c23b1830e9b6cb35d71413a5387dc6fe367bfad /web/js/map-tilma-ol.js
parent6f5bebbb14ec2291ef6b3621f24acffeb9d70a98 (diff)
Fixes to other map types to work with lat/lon. Split OSM JavaScript into core OpenLayers bits and OSM config bit.
Diffstat (limited to 'web/js/map-tilma-ol.js')
-rw-r--r--web/js/map-tilma-ol.js33
1 files changed, 16 insertions, 17 deletions
diff --git a/web/js/map-tilma-ol.js b/web/js/map-tilma-ol.js
index cfd196c1d..5230a5d2c 100644
--- a/web/js/map-tilma-ol.js
+++ b/web/js/map-tilma-ol.js
@@ -1,21 +1,19 @@
-YAHOO.util.Event.onContentReady('map', function() {
- var map = new OpenLayers.Map("map", {
- controls: [
- new OpenLayers.Control.ArgParser(),
- new OpenLayers.Control.Navigation(),
- new OpenLayers.Control.PanPanel()
- ]
- });
- var tilma = new OpenLayers.Layer.Tilma("Tilma", {
+function set_map_config(perm) {
+ fixmystreet.controls = [
+ new OpenLayers.Control.ArgParser(),
+ perm,
+ new OpenLayers.Control.Navigation(),
+ new OpenLayers.Control.PanPanel()
+ ];
+ fixmystreet.map_type = OpenLayers.Layer.Tilma;
+ fixmystreet.layer_options = {
maxResolution: fixmystreet.maxResolution,
tileSize: new OpenLayers.Size(fixmystreet.tilewidth, fixmystreet.tileheight),
- map_type: fixmystreet.tile_type
- });
- map.addLayer(tilma);
-
- var centre = new OpenLayers.LonLat( fixmystreet.easting, fixmystreet.northing );
- map.setCenter(centre);
-});
+ map_type: fixmystreet.tile_type,
+ numZoomLevels: 1,
+ zoomOffset: 0
+ };
+}
OpenLayers.Layer.Tilma = OpenLayers.Class(OpenLayers.Layer.XYZ, {
initialize: function(name, options) {
@@ -23,8 +21,9 @@ OpenLayers.Layer.Tilma = OpenLayers.Class(OpenLayers.Layer.XYZ, {
options = OpenLayers.Util.extend({
transitionEffect: "resize",
numZoomLevels: 1,
+ projection: "EPSG:27700",
units: "m",
- maxExtent: new OpenLayers.Bounds(0, 0, 700000, 1300000),
+ maxExtent: new OpenLayers.Bounds(0, 0, 700000, 1300000)
}, options);
var newArguments = [name, url, options];
OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArguments);