Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   //style
  2. var estilo_ruas = new OpenLayers.StyleMap({
  3.                     "default": new OpenLayers.Style({
  4.                     strokeColor: "#ff0000",
  5.                     strokeOpacity: .7,
  6.                     strokeWidth: 2,
  7.                     fillColor: "#ff0000",
  8.                     fillOpacity: 0,
  9.                     cursor: "pointer"
  10.                     }),
  11.                                                         "temporary": new OpenLayers.Style({
  12.                 strokeColor: "#ffff33",
  13.                 strokeOpacity: .9,
  14.                 strokeWidth: 3,
  15.                 fillColor: "#ffff33",
  16.                 fillOpacity: .3,
  17.                 cursor: "pointer"
  18.                 }),
  19.                 "select": new OpenLayers.Style({
  20.                 strokeColor: "#0033ff",
  21.                 strokeOpacity: .7,
  22.                 strokeWidth: 3,
  23.                 fillColor: "#0033ff",
  24.                 fillOpacity: 0,
  25.                 graphicZIndex: 2,
  26.                 cursor: "pointer"
  27.                 })
  28.             });
  29.                                            
  30. //Create layer
  31. var ruas = new OpenLayers.Layer.Vector("Ruas", {
  32.                         strategies  : [new OpenLayers.Strategy.BBOX()],
  33.                         styleMap: estilo_ruas,
  34.                         isBaseLayer: false,
  35.                         visibility: true,
  36.                         protocol: new OpenLayers.Protocol.WFS({
  37.                         version : "1.1.0",
  38.                         srsName: "EPSG:900913",
  39.                         url: "http://my_server.pt/cgi-bin/mapserv?map=../www/mapserver/file_map.pt.map",
  40.                                                                                 featureType: "ruas",
  41.                         featureNS: "nameserver.pt",
  42.                         geometryName: "the_geom",
  43.                         schema: "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
  44.                         })
  45.                         }
  46.                 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement