Remove unnecessary abstraction around rectangles

This commit is contained in:
Tom MacWright 2013-06-10 12:46:48 -07:00 committed by John Firebaugh
parent 2a9286a16a
commit 7d84b81fd9
3 changed files with 11 additions and 14 deletions

View file

@ -33,7 +33,12 @@ $(document).ready(function () {
[params.maxlat, params.maxlon]);
map.fitBounds(bbox);
addBoxToMap(bbox);
L.rectangle(bbox, {
weight: 2,
color: '#e90',
fillOpacity: 0
}).addTo(map);
$("#loading").hide();
$("#browse_map .geolink").show();

View file

@ -48,7 +48,11 @@ $(document).ready(function () {
map.fitBounds(bbox);
if (params.box) {
addBoxToMap(bbox);
L.rectangle(bbox, {
weight: 2,
color: '#e90',
fillOpacity: 0
}).addTo(map);
}
} else {
map.setView([params.lat, params.lon], params.zoom);

View file

@ -151,18 +151,6 @@ function addObjectToMap(object, options) {
});
}
function addBoxToMap(bounds) {
var box = L.rectangle(bounds, {
weight: 2,
color: '#e90',
fillOpacity: 0
});
box.addTo(map);
return box;
}
function getMapBaseLayer() {
for (var i = 0; i < layers.length; i++) {
if (map.hasLayer(layers[i].layer)) {