]> git.openstreetmap.org Git - rails.git/blobdiff - public/javascripts/map.js
Add history for ways and nodes, split 'last edited by' into a seperate template to...
[rails.git] / public / javascripts / map.js
index 631999a0a99729854ae8e47080a3eef15ce48f2a..bc2e9086326dbbbe1b24b6bdbc9da474c1ef9b7b 100644 (file)
@@ -7,9 +7,10 @@ OpenLayers._getScriptLocation = function () {
    return "/openlayers/";
 }
 
-function createMap(divName) {
+function createMap(divName, options) {
+   if (!options) { options = {} }
    map = new OpenLayers.Map(divName, {
-      controls: [
+      controls: options.controls || [
          new OpenLayers.Control.ArgParser(),
          new OpenLayers.Control.Attribution(),
          new OpenLayers.Control.LayerSwitcher(),
@@ -18,7 +19,7 @@ function createMap(divName) {
          new OpenLayers.Control.ScaleLine()
       ],
       units: "m",
-      maxResolution: 156543,
+      maxResolution: 156543.0339,
       numZoomLevels: 20
    });
 
@@ -110,7 +111,7 @@ function setMapExtent(extent) {
 }
 
 function getEventPosition(event) {
-   return map.getLonLatFromViewPortPx(e.xy).clone().transform(epsg4326, map.getProjectionObject());
+   return map.getLonLatFromViewPortPx(event.xy).clone().transform(map.getProjectionObject(), epsg4326);
 }
 
 function getMapLayers() {