don't try to highlight empty spaces in editor
This commit is contained in:
parent
ef223ee09c
commit
e31b318b47
1 changed files with 17 additions and 17 deletions
|
@ -1024,27 +1024,27 @@ editor = {
|
||||||
_highlight_geometry: function(id) {
|
_highlight_geometry: function(id) {
|
||||||
// highlight a geometries layer and itemtable row if they both exist
|
// highlight a geometries layer and itemtable row if they both exist
|
||||||
var geometry = editor._highlight_geometries[id];
|
var geometry = editor._highlight_geometries[id];
|
||||||
if (geometry !== undefined) {
|
if (!geometry) return;
|
||||||
geometry.setStyle({
|
if (Object.keys(geometry._bounds).length === 0) return; // ignore geometries with empty bounds
|
||||||
color: '#FFFFDD',
|
geometry.setStyle({
|
||||||
weight: 3,
|
color: '#FFFFDD',
|
||||||
opacity: 1,
|
weight: 3,
|
||||||
fillOpacity: 0
|
opacity: 1,
|
||||||
});
|
fillOpacity: 0
|
||||||
geometry.list_elem.addClass('highlight');
|
});
|
||||||
}
|
geometry.list_elem.addClass('highlight');
|
||||||
},
|
},
|
||||||
_unhighlight_geometry: function(id) {
|
_unhighlight_geometry: function(id) {
|
||||||
// unhighlight whatever is highlighted currently
|
// unhighlight whatever is highlighted currently
|
||||||
var geometry = editor._highlight_geometries[id];
|
var geometry = editor._highlight_geometries[id];
|
||||||
if (geometry !== undefined) {
|
if (!geometry) return;
|
||||||
geometry.setStyle({
|
if (Object.keys(geometry._bounds).length === 0) return; // ignore geometries with empty bounds
|
||||||
weight: 3,
|
geometry.setStyle({
|
||||||
opacity: 0,
|
weight: 3,
|
||||||
fillOpacity: 0
|
opacity: 0,
|
||||||
});
|
fillOpacity: 0
|
||||||
geometry.list_elem.removeClass('highlight');
|
});
|
||||||
}
|
geometry.list_elem.removeClass('highlight');
|
||||||
},
|
},
|
||||||
|
|
||||||
// graph events
|
// graph events
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue