Changes between Version 33 and Version 34 of ZooWorkshop/FOSS4GJapan/BuildingWPSClientUsingOL


Ignore:
Timestamp:
Oct 23, 2010, 12:06:25 AM (14 years ago)
Author:
djay
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ZooWorkshop/FOSS4GJapan/BuildingWPSClientUsingOL

    v33 v34  
    6565{{{
    6666#!js
    67 select = new OpenLayers.Layer.Vector("Selection", {styleMap:
    68                 new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])
    69             });
     67select = new OpenLayers.Layer.Vector("Selection", {
     68  styleMap: new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])
     69});
     70     
    7071hover = 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             });
     72multi = 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});
    8181
    8282map.addLayers([layer, select, hover, multi]);
     
    8888#!js
    8989control = 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      });
    9296control.events.register("featureselected", this, function(e) {
    9397                select.addFeatures([e.feature]);
     
    96100                select.removeFeatures([e.feature]);
    97101            });
    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             });
    104102map.addControl(control);
    105103control.activate();
     
    108106Please 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.
    109107
    110 [[Image(OL-2.png,width=500px,nolink,margin: 5)]]
     108[[Image(OL-JP-2.png,width=500px,nolink,margin: 5)]]
    111109== Calling the single geometry seervices from !JavaScript ==
    112110

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png