X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/fdd5d2d7791f9138c339c9f18bcaa8946bd18d0c..d97cfc35d61c4892494bc1cefa22d12901b9ea9a:/public/javascripts/map.js diff --git a/public/javascripts/map.js b/public/javascripts/map.js index a52cd0a70..92967adcd 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -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; }