]> git.openstreetmap.org Git - rails.git/blobdiff - public/javascripts/map.js
Merge 14394:14533 from trunk.
[rails.git] / public / javascripts / map.js
index a52cd0a7047dcd43006ae2bd68466b5d8e64affe..3cfa2f9a1dace745cc8ecf22faa55b40d26f082b 100644 (file)
@@ -118,16 +118,16 @@ function addMarkerToMap(position, icon, description) {
    return marker;
 }
 
-function addBoxToMap(boxbounds) {      
-   box = new OpenLayers.Feature.Vector(
-            boxbounds.toGeometry().transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) );
+function addBoxToMap(boxbounds) {
+   var geometry = boxbounds.toGeometry().transform(epsg4326, map.getProjectionObject());
+   var box = new OpenLayers.Feature.Vector(geometry, {}, {
+      strokeWidth: 2,
+      strokeColor: '#ee9900',
+      fillOpacity: 0,
+   });
    
-   box.style = {
-         'strokeWidth': 3,
-         'strokeColor': '#0000ff',
-         'fillOpacity': 0,
-       };
    vectors.addFeatures(box);
+
    return box;
 }