Ticket #1035: projections.3.patch
| File projections.3.patch, 6.6 kB (added by crschmidt, 1 year ago) |
|---|
-
tests/Layer/test_WMS.html
old new 236 236 t.eq(str, 237 237 tUrl + "?" + OpenLayers.Util.getParameterString(tParams), 238 238 "getFullRequestString() adds SRS value"); 239 239 240 map.removeLayer(tLayer); 240 241 tLayer.projection = "none"; 242 map.addLayer(tLayer); 241 243 str = tLayer.getFullRequestString(); 242 244 delete tParams['SRS']; 243 245 t.eq(str, -
tests/list-tests.html
old new 87 87 <li>Handler/test_Path.html</li> 88 88 <li>Handler/test_Polygon.html</li> 89 89 <li>Handler/test_RegularPolygon.html</li> 90 <li>test_Projection.html</li> 90 91 <li>Renderer/test_Elements.html</li> 91 92 <li>Renderer/test_SVG.html</li> 92 93 <li>Renderer/test_VML.html</li> -
lib/OpenLayers/Layer.js
old new 126 126 127 127 /** 128 128 * APIProperty: projection 129 * {String} Set in the layer options to override the default projection 130 * string this layer - also set maxExtent, maxResolution, and units if 131 * appropriate. 129 * {<OpenLayers.Projection>} or {<String>} Set in the layer options to 130 * override the default projection string this layer - also set maxExtent, 131 * maxResolution, and units if appropriate. Can be either a string or 132 * an <OpenLayers.Projection> object when created -- will be converted 133 * to an object when setMap is called if a string is passed. 132 134 */ 133 135 projection: null, 134 136 … … 267 269 if (this.map != null) { 268 270 this.map.removeLayer(this, setNewBaseLayer); 269 271 } 272 this.projection = null; 270 273 this.map = null; 271 274 this.name = null; 272 275 this.div = null; … … 410 413 // been set 411 414 this.maxExtent = this.maxExtent || this.map.maxExtent; 412 415 this.projection = this.projection || this.map.projection; 413 this.units = this.units || this.map.units;414 416 417 if (this.projection && typeof this.projection == "string") { 418 this.projection = new OpenLayers.Projection(this.projection); 419 } 420 421 // Check the projection to see if we can get units -- if not, refer 422 // to properties. 423 this.units = this.projection.getUnits() || 424 this.units || this.map.units; 425 415 426 this.initResolutions(); 416 427 417 428 if (!this.isBaseLayer) { -
lib/OpenLayers/Format/GeoJSON.js
old new 488 488 * of a GeoJSON object. 489 489 */ 490 490 createCRSObject: function(object) { 491 var proj = object.layer.projection ;491 var proj = object.layer.projection.toString(); 492 492 var crs = {}; 493 493 if (proj.match(/epsg:/i)) { 494 494 var code = parseInt(proj.substring(proj.indexOf(":") + 1)); -
lib/OpenLayers/Map.js
old new 1391 1391 1392 1392 /** 1393 1393 * APIMethod: getProjection 1394 * This method returns a string representing the projection. In 1395 * the case of projection support, this will be the srsCode which 1396 * is loaded -- otherwise it will simply be the string value that 1397 * was passed to the projection at startup. 1398 * 1399 * FIXME: In 3.0, we will remove getProjectionObject, and instead 1400 * return a Projection object from this function. 1394 1401 * 1395 1402 * Returns: 1396 * {String} The Projection of the base layer.1403 * {String} The Projection string from the base layer or null. 1397 1404 */ 1398 1405 getProjection: function() { 1406 var projection = this.getProjectionObject(); 1407 return projection ? projection.getCode() : null; 1408 }, 1409 1410 /** 1411 * APIMethod: getProjectionObject 1412 * Returns the projection obect from the baselayer. 1413 * 1414 * Returns: 1415 * {<OpenLayers.Projection>} The Projection of the base layer. 1416 */ 1417 getProjectionObject: function() { 1399 1418 var projection = null; 1400 1419 if (this.baseLayer != null) { 1401 1420 projection = this.baseLayer.projection; -
lib/OpenLayers/Layer/WMS.js
old new 211 211 * {String} 212 212 */ 213 213 getFullRequestString:function(newParams, altUrl) { 214 var projection = this.map.getProjection();215 this.params.SRS = (projection == "none") ? null : projection;214 var projectionCode = this.map.getProjection(); 215 this.params.SRS = (projectionCode == "none") ? null : projectionCode; 216 216 217 217 return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply( 218 218 this, arguments); -
lib/OpenLayers/Layer/WFS.js
old new 376 376 * altUrl - {String} Use this as the url instead of the layer's url 377 377 */ 378 378 getFullRequestString:function(newParams, altUrl) { 379 var projection = this.map.getProjection();380 this.params.SRS = (projection == "none") ? null : projection;379 var projectionCode = this.map.getProjection(); 380 this.params.SRS = (projectionCode == "none") ? null : projectionCode; 381 381 382 382 return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply( 383 383 this, arguments); -
lib/OpenLayers.js
old new 175 175 "OpenLayers/Layer/WFS.js", 176 176 "OpenLayers/Control/MouseToolbar.js", 177 177 "OpenLayers/Control/NavToolbar.js", 178 "OpenLayers/Control/EditingToolbar.js" 178 "OpenLayers/Control/EditingToolbar.js", 179 "OpenLayers/Projection.js" 179 180 ); // etc. 180 181 181 182
