Changeset 5401
- Timestamp:
- 12/13/07 18:29:18 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Format/GeoJSON.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/WFS.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/WMS.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
- trunk/openlayers/tests/Layer/test_WMS.html (modified) (1 diff)
- trunk/openlayers/tests/list-tests.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers.js
r5027 r5401 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 trunk/openlayers/lib/OpenLayers/Format/GeoJSON.js
r5002 r5401 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)) { trunk/openlayers/lib/OpenLayers/Layer.js
r5357 r5401 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, … … 268 270 this.map.removeLayer(this, setNewBaseLayer); 269 271 } 272 this.projection = null; 270 273 this.map = null; 271 274 this.name = null; … … 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; 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; 414 425 415 426 this.initResolutions(); trunk/openlayers/lib/OpenLayers/Layer/WFS.js
r4985 r5401 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( trunk/openlayers/lib/OpenLayers/Layer/WMS.js
r5360 r5401 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( trunk/openlayers/lib/OpenLayers/Map.js
r5387 r5401 1406 1406 /** 1407 1407 * APIMethod: getProjection 1408 * 1409 * Returns: 1410 * {String} The Projection of the base layer. 1408 * This method returns a string representing the projection. In 1409 * the case of projection support, this will be the srsCode which 1410 * is loaded -- otherwise it will simply be the string value that 1411 * was passed to the projection at startup. 1412 * 1413 * FIXME: In 3.0, we will remove getProjectionObject, and instead 1414 * return a Projection object from this function. 1415 * 1416 * Returns: 1417 * {String} The Projection string from the base layer or null. 1411 1418 */ 1412 1419 getProjection: function() { 1420 var projection = this.getProjectionObject(); 1421 return projection ? projection.getCode() : null; 1422 }, 1423 1424 /** 1425 * APIMethod: getProjectionObject 1426 * Returns the projection obect from the baselayer. 1427 * 1428 * Returns: 1429 * {<OpenLayers.Projection>} The Projection of the base layer. 1430 */ 1431 getProjectionObject: function() { 1413 1432 var projection = null; 1414 1433 if (this.baseLayer != null) { trunk/openlayers/tests/Layer/test_WMS.html
r4761 r5401 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']; trunk/openlayers/tests/list-tests.html
r5319 r5401 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>
