SHOW:
|
|
- or go back to the newest paste.
| 1 | - | //style |
| 1 | + | //style |
| 2 | - | var estilo_ruas = new OpenLayers.StyleMap({
|
| 2 | + | var estilo_ruas = new OpenLayers.StyleMap({
|
| 3 | - | "default": new OpenLayers.Style({
|
| 3 | + | "default": new OpenLayers.Style({
|
| 4 | - | strokeColor: "#ff0000", |
| 4 | + | strokeColor: "#ff0000", |
| 5 | - | strokeOpacity: .7, |
| 5 | + | strokeOpacity: .7, |
| 6 | - | strokeWidth: 2, |
| 6 | + | strokeWidth: 2, |
| 7 | - | fillColor: "#ff0000", |
| 7 | + | fillColor: "#ff0000", |
| 8 | - | fillOpacity: 0, |
| 8 | + | fillOpacity: 0, |
| 9 | - | cursor: "pointer" |
| 9 | + | cursor: "pointer" |
| 10 | - | }), |
| 10 | + | }), |
| 11 | - | "temporary": new OpenLayers.Style({
|
| 11 | + | "temporary": new OpenLayers.Style({
|
| 12 | - | strokeColor: "#ffff33", |
| 12 | + | strokeColor: "#ffff33", |
| 13 | - | strokeOpacity: .9, |
| 13 | + | strokeOpacity: .9, |
| 14 | - | strokeWidth: 3, |
| 14 | + | strokeWidth: 3, |
| 15 | - | fillColor: "#ffff33", |
| 15 | + | fillColor: "#ffff33", |
| 16 | - | fillOpacity: .3, |
| 16 | + | fillOpacity: .3, |
| 17 | - | cursor: "pointer" |
| 17 | + | cursor: "pointer" |
| 18 | - | }), |
| 18 | + | }), |
| 19 | - | "select": new OpenLayers.Style({
|
| 19 | + | "select": new OpenLayers.Style({
|
| 20 | - | strokeColor: "#0033ff", |
| 20 | + | strokeColor: "#0033ff", |
| 21 | - | strokeOpacity: .7, |
| 21 | + | strokeOpacity: .7, |
| 22 | - | strokeWidth: 3, |
| 22 | + | strokeWidth: 3, |
| 23 | - | fillColor: "#0033ff", |
| 23 | + | fillColor: "#0033ff", |
| 24 | - | fillOpacity: 0, |
| 24 | + | fillOpacity: 0, |
| 25 | - | graphicZIndex: 2, |
| 25 | + | graphicZIndex: 2, |
| 26 | - | cursor: "pointer" |
| 26 | + | cursor: "pointer" |
| 27 | - | }) |
| 27 | + | }) |
| 28 | - | }); |
| 28 | + | }); |
| 29 | ||
| 30 | //Create layer | |
| 31 | - | //Create layer |
| 31 | + | var ruas = new OpenLayers.Layer.Vector("Ruas", {
|
| 32 | - | var ruas = new OpenLayers.Layer.Vector("Ruas", {
|
| 32 | + | strategies : [new OpenLayers.Strategy.BBOX()], |
| 33 | - | strategies : [new OpenLayers.Strategy.BBOX()], |
| 33 | + | styleMap: estilo_ruas, |
| 34 | - | styleMap: estilo_ruas, |
| 34 | + | isBaseLayer: false, |
| 35 | - | isBaseLayer: false, |
| 35 | + | visibility: true, |
| 36 | - | visibility: true, |
| 36 | + | protocol: new OpenLayers.Protocol.WFS({
|
| 37 | - | protocol : new OpenLayers.Protocol.WFS({
|
| 37 | + | version : "1.1.0", |
| 38 | - | version : "1.1.0", |
| 38 | + | srsName: "EPSG:900913", |
| 39 | - | srsName : "EPSG:900913", |
| 39 | + | url: "http://my_server.pt/cgi-bin/mapserv?map=../www/mapserver/file_map.pt.map", |
| 40 | - | url : "http://my_server.pt/cgi-bin/mapserv?map=../www/mapserver/file_map.pt.map", |
| 40 | + | featureType: "ruas", |
| 41 | - | featureType : "ruas", |
| 41 | + | featureNS: "nameserver.pt", |
| 42 | - | featureNS : "nameserver.pt", |
| 42 | + | geometryName: "the_geom", |
| 43 | - | geometryName : "the_geom", |
| 43 | + | schema: "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" |
| 44 | - | schema : "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" |
| 44 | + | }) |
| 45 | - | }) |
| 45 | + | } |
| 46 | - | } |
| 46 | + | ); |