don't throw an exception if geometry to highlight does not exist
This commit is contained in:
parent
1e30d615e6
commit
0931516b16
1 changed files with 21 additions and 15 deletions
|
@ -309,24 +309,30 @@ editor = {
|
|||
},
|
||||
_highlight_geometry: function(id) {
|
||||
// highlight a geometries layer and itemtable row if they both exist
|
||||
editor._highlight_geometries[id].setStyle({
|
||||
color: '#FFFFDD',
|
||||
weight: 3,
|
||||
opacity: 1,
|
||||
fillOpacity: 0,
|
||||
className: 'c3nav-highlight'
|
||||
});
|
||||
$('#sidebar').find('[data-list] tr[data-pk='+String(id)+']').addClass('highlight');
|
||||
var geometry = editor._highlight_geometries[id];
|
||||
if (geometry !== undefined) {
|
||||
geometry.setStyle({
|
||||
color: '#FFFFDD',
|
||||
weight: 3,
|
||||
opacity: 1,
|
||||
fillOpacity: 0,
|
||||
className: 'c3nav-highlight'
|
||||
});
|
||||
$('#sidebar').find('[data-list] tr[data-pk='+String(id)+']').addClass('highlight');
|
||||
}
|
||||
},
|
||||
_unhighlight_geometry: function(id) {
|
||||
// unhighlight whatever is highlighted currently
|
||||
editor._highlight_geometries[id].setStyle({
|
||||
weight: 3,
|
||||
opacity: 0,
|
||||
fillOpacity: 0,
|
||||
className: 'c3nav-highlight'
|
||||
});
|
||||
$('#sidebar').find('[data-list] tr[data-pk='+String(id)+']').removeClass('highlight');
|
||||
var geometry = editor._highlight_geometries[id];
|
||||
if (geometry !== undefined) {
|
||||
geometry.setStyle({
|
||||
weight: 3,
|
||||
opacity: 0,
|
||||
fillOpacity: 0,
|
||||
className: 'c3nav-highlight'
|
||||
});
|
||||
$('#sidebar').find('[data-list] tr[data-pk='+String(id)+']').removeClass('highlight');
|
||||
}
|
||||
},
|
||||
|
||||
// edit and create geometries
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue