[Commits] r396 - apps/opengeo/geoexplorer/trunk/lib

commits at geoext.org commits at geoext.org
Wed Apr 15 09:28:37 CEST 2009


Author: tschaub
Date: 2009-04-15 09:28:37 +0200 (Wed, 15 Apr 2009)
New Revision: 396

Modified:
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
Log:
Nicer style for measure sketch.

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-15 07:23:15 UTC (rev 395)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-15 07:28:37 UTC (rev 396)
@@ -606,7 +606,42 @@
     },
 
     createMeasureTool: function(handlerType, title) {
-        var measureControl = new OpenLayers.Control.Measure(handlerType, {persist: true});
+        
+        var styleMap = new OpenLayers.StyleMap({
+            "default": new OpenLayers.Style(null, {
+                rules: [new OpenLayers.Rule({
+                    symbolizer: {
+                        "Point": {
+                            pointRadius: 4,
+                            graphicName: "square",
+                            fillColor: "white",
+                            fillOpacity: 1,
+                            strokeWidth: 1,
+                            strokeOpacity: 1,
+                            strokeColor: "#333333"
+                        },
+                        "Line": {
+                            strokeWidth: 3,
+                            strokeOpacity: 1,
+                            strokeColor: "#666666",
+                            strokeDashstyle: "dash"
+                        },
+                        "Polygon": {
+                            strokeWidth: 2,
+                            strokeOpacity: 1,
+                            strokeColor: "#666666",
+                            fillColor: "white",
+                            fillOpacity: 0.3
+                        }
+                    }
+                })]
+            })
+        });
+        
+        var measureControl = new OpenLayers.Control.Measure(handlerType, {
+            persist: true,
+            handlerOptions: {layerOptions: {styleMap: styleMap}}
+        });
 
         var measureToolTip; 
         



More information about the Commits mailing list