[fusion-commits] r2936 - in trunk: lib widgets/widgetinfo
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed May 4 07:06:11 PDT 2016
Author: jng
Date: 2016-05-04 07:06:11 -0700 (Wed, 04 May 2016)
New Revision: 2936
Modified:
trunk/lib/Map.js
trunk/widgets/widgetinfo/measure.xml
Log:
#645: Fix measure not measuring in units other than meters (whatever configured unit was being clobbered by the Map widget). Also expand the list of supported units in the widgetinfo.
Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js 2016-04-21 01:17:44 UTC (rev 2935)
+++ trunk/lib/Map.js 2016-05-04 14:06:11 UTC (rev 2936)
@@ -337,7 +337,6 @@
fillOpacity: 0.4,
strokeWidth: 2,
strokeOpacity: 1,
- strokeColor: "#666666",
strokeColor: "#666666"
}));
this.keyHandler = OpenLayers.Function.bind(this.onKeyPress, this);
@@ -1461,17 +1460,21 @@
*
*/
setWidgetParam: function(param, data) {
- for (var i=0; i<Fusion.applicationDefinition.widgetSets.length; ++i) {
- var widgetSet = Fusion.applicationDefinition.widgetSets[i];
- for (var j=0; j<widgetSet.widgetInstances.length; ++j) {
- var widget = widgetSet.widgetInstances[j];
- for (var k=0; k<widget.paramRegister.length; ++k) {
- if (widget.paramRegister[k] == param) {
- widget.setParameter(param, data);
+ for (var i = 0; i < Fusion.applicationDefinition.widgetSets.length; ++i) {
+ var widgetSet = Fusion.applicationDefinition.widgetSets[i];
+ for (var j = 0; j < widgetSet.widgetInstances.length; ++j) {
+ var widget = widgetSet.widgetInstances[j];
+ // Respect the unit value of the measure widget
+ if (widget.type == "Measure" && param == "Units") {
+ continue;
+ }
+ for (var k = 0; k < widget.paramRegister.length; ++k) {
+ if (widget.paramRegister[k] == param) {
+ widget.setParameter(param, data);
+ }
+ }
}
- }
}
- }
},
/**
Modified: trunk/widgets/widgetinfo/measure.xml
===================================================================
--- trunk/widgets/widgetinfo/measure.xml 2016-04-21 01:17:44 UTC (rev 2935)
+++ trunk/widgets/widgetinfo/measure.xml 2016-05-04 14:06:11 UTC (rev 2936)
@@ -27,6 +27,34 @@
<Name>Degrees</Name>
<Label>Degrees</Label>
</AllowedValue>
+ <AllowedValue>
+ <Name>Kilometers</Name>
+ <Label>Kilometers</Label>
+ </AllowedValue>
+ <AllowedValue>
+ <Name>Feet</Name>
+ <Label>Feet</Label>
+ </AllowedValue>
+ <AllowedValue>
+ <Name>Inches</Name>
+ <Label>Inches</Label>
+ </AllowedValue>
+ <AllowedValue>
+ <Name>Nautical Miles</Name>
+ <Label>Nautical Miles</Label>
+ </AllowedValue>
+ <AllowedValue>
+ <Name>Millimeters</Name>
+ <Label>Millimeters</Label>
+ </AllowedValue>
+ <AllowedValue>
+ <Name>Centimeters</Name>
+ <Label>Centimeters</Label>
+ </AllowedValue>
+ <AllowedValue>
+ <Name>Pixels</Name>
+ <Label>Pixels</Label>
+ </AllowedValue>
<DefaultValue>none</DefaultValue>
<IsMandatory>false</IsMandatory>
</Parameter>
More information about the fusion-commits
mailing list