]> git.openstreetmap.org Git - rails.git/blobdiff - public/javascripts/map.js
join/unjoin fixes, plus better amf_controller error handling for deleted items
[rails.git] / public / javascripts / map.js
index 32953c4397213cfbd9dcc7e235ca40512d351ff2..2349c3230d5770e5aa0f7a486415fb02b92b6a3f 100644 (file)
@@ -13,12 +13,6 @@ var nonamekeys = {
    'www.openstreetmap.net': '0bd1654141c85d30b9c2ccdb5302f2e4'
 };
 
-OpenLayers._getScriptLocation = function () {
-  // Should really have this file as an erb, so that this can return
-  // the real rails root
-   return "/openlayers/";
-}
-
 function createMap(divName, options) {
    options = options || {};
 
@@ -28,6 +22,7 @@ function createMap(divName, options) {
          new OpenLayers.Control.Attribution(),
          new OpenLayers.Control.LayerSwitcher(),
          new OpenLayers.Control.Navigation(),
+         new OpenLayers.Control.PanZoom(),
          new OpenLayers.Control.PanZoomBar()
       ],
       units: "m",
@@ -198,7 +193,7 @@ function removeBoxFromMap(box){
    vectors.removeFeature(box);
 }
 
-function getMapCenter(center, zoom) {
+function getMapCenter() {
    return map.getCenter().clone().transform(map.getProjectionObject(), epsg4326);
 }
 
@@ -217,6 +212,10 @@ function getMapExtent() {
    return map.getExtent().clone().transform(map.getProjectionObject(), epsg4326);
 }
 
+function getMapZoom() {
+   return map.getZoom();
+}
+
 function getEventPosition(event) {
    return map.getLonLatFromViewPortPx(event.xy).clone().transform(map.getProjectionObject(), epsg4326);
 }