Changeset 6165
- Timestamp:
- 02/09/08 00:02:23 (1 year ago)
- Files:
-
- sandbox/ahocevar/styleMap/examples/openmnnd.html (modified) (3 diffs)
- sandbox/ahocevar/styleMap/examples/osm-layer.html (modified) (1 diff)
- sandbox/ahocevar/styleMap/examples/wfs-scribble.html (modified) (1 diff)
- sandbox/ahocevar/styleMap/lib/OpenLayers/Layer/Vector.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/ahocevar/styleMap/examples/openmnnd.html
r6152 r6165 17 17 18 18 function init(){ 19 OpenLayers.ProxyHost="/ proxy/?url=";19 OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url="; 20 20 map = new OpenLayers.Map('map', {'maxResolution':'auto', maxExtent: new OpenLayers.Bounds(-203349.72008129774,4816309.33,1154786.8041952979,5472346.5), projection: 'EPSG:26915' } ); 21 21 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", … … 29 29 map.addLayer(wms); 30 30 31 wfs = new OpenLayers.Layer.WFS("Minnesota Streams (WFS)", wfs_url, {'typename':'streams'}, {ratio:1.25, minZoomLevel:4 });31 wfs = new OpenLayers.Layer.WFS("Minnesota Streams (WFS)", wfs_url, {'typename':'streams'}, {ratio:1.25, minZoomLevel:4, style: OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default'])}); 32 32 33 33 // preFeatureInsert can be used to set style before the feature is drawn 34 wfs.preFeatureInsert= function(feature) { feature.style.strokeWidth="3"; feature.style.strokeColor="blue"; 34 wfs.preFeatureInsert= function(feature) { 35 feature.style = OpenLayers.Util.extend({}, feature.layer.style); 36 feature.style.strokeWidth="3"; feature.style.strokeColor="blue"; 35 37 } 36 38 wfs.onFeatureInsert = function(feature) { … … 58 60 59 61 rstyle = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']); 60 OpenLayers.Util.extend(rstyle, {'strokeColor': 'white', strokeW Idth: "4"});62 OpenLayers.Util.extend(rstyle, {'strokeColor': 'white', strokeWidth: "4"}); 61 63 rwfs = new OpenLayers.Layer.WFS("Minnesota Roads (WFS)", wfs_url, {'typename':'roads'}, 62 64 {ratio:1.25, minZoomLevel:7, extractAttributes: true, style:rstyle}); sandbox/ahocevar/styleMap/examples/osm-layer.html
r6152 r6165 48 48 } 49 49 function style_osm_feature(feature) { 50 feature.style .fill = "black";50 feature.style = OpenLayers.Util.extend({'fill':'black'}, OpenLayers.Feature.Vector.style['default']); 51 51 if (feature.attributes.highway == "motorway") { 52 52 feature.style.strokeColor = "blue"; sandbox/ahocevar/styleMap/examples/wfs-scribble.html
r6152 r6165 36 36 df.featureAdded = function(feature) { 37 37 feature.state = OpenLayers.State.INSERT; 38 feature.style ['strokeColor'] = "#ff0000";38 feature.style = OpenLayers.Util.extend({'strokeColor': '#ff0000'}, OpenLayers.Feature.Vector.style['default']); 39 39 feature.layer.drawFeature(feature); 40 40 } sandbox/ahocevar/styleMap/lib/OpenLayers/Layer/Vector.js
r6152 r6165 310 310 } 311 311 312 if (this.style) { 313 feature.style = OpenLayers.Util.extend({}, this.style); 314 } 315 312 316 this.features.push(feature); 313 317
