Ticket #1406: projected_wfs.patch
| File projected_wfs.patch, 3.1 kB (added by crschmidt, 10 months ago) |
|---|
-
lib/OpenLayers/Layer/WFS.js
old new 277 277 278 278 var params = {BBOX: this.encodeBBOX ? tileBounds.toBBOX() 279 279 : tileBounds.toArray()}; 280 281 if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 282 var projectedBounds = tileBounds.clone(); 283 projectedBounds.transform(this.map.getProjectionObject(), 284 this.projection); 285 params.BBOX = this.encodeBBOX ? projectedBounds.toBBOX() 286 : projectedBounds.toArray(); 287 } 288 280 289 url += "&" + OpenLayers.Util.getParameterString(params); 281 290 282 291 if (!this.tile) { … … 434 443 */ 435 444 commit: function() { 436 445 if (!this.writer) { 437 this.writer = new OpenLayers.Format.WFS({},this); 446 var options = {}; 447 if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 448 options.externalProjection = this.projection; 449 options.internalProjection = this.map.getProjectionObject(); 450 } 451 452 this.writer = new OpenLayers.Format.WFS(options,this); 438 453 } 439 454 440 455 var data = this.writer.write(this.features); -
examples/spherical-mercator.html
old new 24 24 OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3; 25 25 OpenLayers.Util.onImageLoadErrorColor = "transparent"; 26 26 27 // Ability to load WFS data 28 OpenLayers.ProxyHost = '/proxy/?url='; 29 27 30 function init(){ 28 31 var options = { 29 32 projection: new OpenLayers.Projection("EPSG:900913"), … … 110 113 'isBaseLayer': false,'wrapDateLine': true 111 114 } 112 115 ); 116 // create WFS layer, which is in EPSG:4326 117 wfs = new OpenLayers.Layer.WFS("WFS", 118 "http://featureserver.org/featureserver.cgi/scribble?format=WFS", 119 {maxfeatures: "50"}, 120 { 121 extractAttributes: true, 122 projection: new OpenLayers.Projection("EPSG:4326") 123 } 124 ); 113 125 114 126 // create a vector layer for drawing 115 127 var vector = new OpenLayers.Layer.Vector("Editable Vectors"); 116 128 117 129 map.addLayers([gmap, gsat, ghyb, veroad, veaer, vehyb, 118 130 yahoo, yahoosat, yahoohyb, mapnik, osmarender, 119 wms, vector ]);131 wms, vector, wfs]); 120 132 map.addControl(new OpenLayers.Control.LayerSwitcher()); 121 133 map.addControl(new OpenLayers.Control.EditingToolbar(vector)); 122 134 map.addControl(new OpenLayers.Control.Permalink());
