Changes between Version 33 and Version 34 of ZooWorkshop/FOSS4GJapan/BuildingWPSClientUsingOL
- Timestamp:
- Oct 23, 2010, 12:06:25 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZooWorkshop/FOSS4GJapan/BuildingWPSClientUsingOL
v33 v34 65 65 {{{ 66 66 #!js 67 select = new OpenLayers.Layer.Vector("Selection", {styleMap: 68 new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"]) 69 }); 67 select = new OpenLayers.Layer.Vector("Selection", { 68 styleMap: new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"]) 69 }); 70 70 71 hover = new OpenLayers.Layer.Vector("Hover"); 71 72 multi = new OpenLayers.Layer.Vector("Multi", {styleMap: 73 new OpenLayers.Style({ 74 fillColor:"red", 75 fillOpacity:0.4, 76 strokeColor:"red", 77 strokeOpacity:1, 78 strokeWidth:2 79 }) 80 }); 72 multi = new OpenLayers.Layer.Vector("Multi", { styleMap: 73 new OpenLayers.Style({ 74 fillColor:"red", 75 fillOpacity:0.4, 76 strokeColor:"red", 77 strokeOpacity:1, 78 strokeWidth:2 79 }) 80 }); 81 81 82 82 map.addLayers([layer, select, hover, multi]); … … 88 88 #!js 89 89 control = new OpenLayers.Control.GetFeature({ 90 protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer) 91 }); 90 protocol: protocol, 91 box: false, 92 hover: false, 93 multipleKey: "shiftKey", 94 toggleKey: "ctrlKey" 95 }); 92 96 control.events.register("featureselected", this, function(e) { 93 97 select.addFeatures([e.feature]); … … 96 100 select.removeFeatures([e.feature]); 97 101 }); 98 control.events.register("hoverfeature", this, function(e) {99 hover.addFeatures([e.feature]);100 });101 control.events.register("outfeature", this, function(e) {102 hover.removeFeatures([e.feature]);103 });104 102 map.addControl(control); 105 103 control.activate(); … … 108 106 Please save your HTML file again. You should now be able to select a polygon only by clicking on it. The selected polygon should appear in blue color. 109 107 110 [[Image(OL- 2.png,width=500px,nolink,margin: 5)]]108 [[Image(OL-JP-2.png,width=500px,nolink,margin: 5)]] 111 109 == Calling the single geometry seervices from !JavaScript == 112 110