From: Gergely Padányi-Gulyás:
"Dear Developers and Users,
I recently found a bug in the LayerNodeMenuItem class. When you right-click on
a node that is not a layer (a folder, for instance), Firebug throws an error:
TypeError: node.layer is undefined
The following modifications should take into consideration:
1. Heron.widgets.LayerNodeMenuItem.Style
Instead of
isApplicable: function (node) {
return node.layer.CLASS_NAME == 'OpenLayers.Layer.Vector';
}
This
isApplicable: function (node) {
return typeof node.layer !== 'undefined' && node.layer.CLASS_NAME == 'OpenLayers.Layer.Vector';
}
2. Heron.widgets.LayerNodeMenuItem.ZoomExtent
Instead of
isApplicable: function (node) {
// Layer: assume fixed maxExtent when set AND different from Map maxExtent
this.hasMaxExtent = node.layer.maxExtent && !node.layer.maxExtent.equals(node.layer.map.maxExtent);
return node.layer.getDataExtent() || this.hasMaxExtent;
}
This
isApplicable: function (node) {
// Layer: assume fixed maxExtent when set AND different from Map maxExtent
this.hasMaxExtent = typeof node.layer !== 'undefined' && node.layer.maxExtent && !node.layer.maxExtent.equals(node.layer.map.maxExtent);
return typeof node.layer !== 'undefined' && (node.layer.getDataExtent() || this.hasMaxExtent);
}
3. Heron.widgets.LayerNodeMenuItem.LayerInfo
Add the missing isApplicable method like this:
isApplicable: function (node) {
return typeof node.layer !== 'undefined';
}
4. Heron.widgets.LayerNodeMenuItem.OpacitySlider
Add the missing isApplicable method like this:
isApplicable: function (node) {
return typeof node.layer !== 'undefined';
}
"
Original issue reported on code.google.com by jus...@gmail.com on 30 Apr 2014 at 12:24
Original issue reported on code.google.com by
jus...@gmail.com
on 30 Apr 2014 at 12:24