Guest User

Untitled

a guest
Jul 23rd, 2013
67
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.                                            
  31.       //Create layer
  32.      var ruas = new OpenLayers.Layer.Vector("Ruas", {
  33.                                                         strategies  : [new OpenLayers.Strategy.BBOX()],
  34.                                                         styleMap: estilo_ruas,
  35.                                                         isBaseLayer: false,
  36.                                                         visibility: true,
  37.                                                         protocol    : new OpenLayers.Protocol.WFS({
  38.                                                             version         : "1.1.0",
  39.                                                             srsName         : "EPSG:900913",
  40.                                                             url             : "http://my_server.pt/cgi-bin/mapserv?map=../www/mapserver/file_map.pt.map",
  41.                                                             featureType     : "ruas",
  42.                                                             featureNS       : "nameserver.pt",
  43.                                                             geometryName    : "the_geom",
  44.                                                             schema          : "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
  45.                                                         })
  46.                                                     }
  47.                    
  48.                                             );
Advertisement
Add Comment
Please, Sign In to add comment