Remove unnecessary abstraction around rectangles
This commit is contained in:
parent
2a9286a16a
commit
7d84b81fd9
3 changed files with 11 additions and 14 deletions
|
@ -33,7 +33,12 @@ $(document).ready(function () {
|
||||||
[params.maxlat, params.maxlon]);
|
[params.maxlat, params.maxlon]);
|
||||||
|
|
||||||
map.fitBounds(bbox);
|
map.fitBounds(bbox);
|
||||||
addBoxToMap(bbox);
|
|
||||||
|
L.rectangle(bbox, {
|
||||||
|
weight: 2,
|
||||||
|
color: '#e90',
|
||||||
|
fillOpacity: 0
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
$("#loading").hide();
|
$("#loading").hide();
|
||||||
$("#browse_map .geolink").show();
|
$("#browse_map .geolink").show();
|
||||||
|
|
|
@ -48,7 +48,11 @@ $(document).ready(function () {
|
||||||
map.fitBounds(bbox);
|
map.fitBounds(bbox);
|
||||||
|
|
||||||
if (params.box) {
|
if (params.box) {
|
||||||
addBoxToMap(bbox);
|
L.rectangle(bbox, {
|
||||||
|
weight: 2,
|
||||||
|
color: '#e90',
|
||||||
|
fillOpacity: 0
|
||||||
|
}).addTo(map);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
map.setView([params.lat, params.lon], params.zoom);
|
map.setView([params.lat, params.lon], params.zoom);
|
||||||
|
|
|
@ -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() {
|
function getMapBaseLayer() {
|
||||||
for (var i = 0; i < layers.length; i++) {
|
for (var i = 0; i < layers.length; i++) {
|
||||||
if (map.hasLayer(layers[i].layer)) {
|
if (map.hasLayer(layers[i].layer)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue