On 01/17/2011 06:45 PM, Roy Hyunjin Han wrote:
If I set my OpenLayers.Layer.Vector projection to 4326 and my map projection to 3857, I get the following sample.
bbox=-974.00597306406,-179.26033291361,825.99402686406,179.62415110059
What are the units here?

If I set my OpenLayers.Layer.Vector projection to 3857 and my map projection to 3857, I get the following sample.
bbox=-108425848.93601,-75336276.762761,91949234.455994,85276876.018639
What are the units here?

However, in Polymaps, I get the following sample, which I am assuming is in latitude, longitude, latitude, longitude format and decimal degree units.
bbox=-85,0,0,180



>> bounds = new
OpenLayers.Bounds(-974.00597306406,-179.26033291361,825.99402686406,179.62415110059)
>> projMap = mapOL.getProjectionObject()
>> projLayer = new OpenLayers.Projection("EPSG:4326");
>> bounds.transform(projLayer, projMap)
left-bottom=(-108425848.93601,NaN) right-top=(91949234.455993,NaN) { left=-108425848.93601, bottom=NaN, more...}


Hmm.


According to the following code in OpenLayers/Strategy/BBox.js, it appears that BBox expresses the bounds in the same projection as the layer. However, the numbers look much more like meters than degrees. I know the map projection is in meters, but the layer projection should be in degrees.

    update: function(options) {
        var mapBounds = this.getMapBounds();
        if ((options && options.force) || this.invalidBounds(mapBounds)) {
            this.calculateBounds(mapBounds);
            this.resolution = this.layer.map.getResolution();
            this.triggerRead();
        }
    },

    /**
     * Method: getMapBounds
     * Get the map bounds expressed in the same projection as this layer.
     *
     * Returns:
     * {<OpenLayers.Bounds>} Map bounds in the projection of the layer.
     */
    getMapBounds: function() {
        var bounds = this.layer.map.getExtent();
if(!this.layer.projection.equals(this.layer.map.getProjectionObject())) {
            bounds = bounds.clone().transform(
                this.layer.map.getProjectionObject(), this.layer.projection
            );
        }
        return bounds;
    },


Still confused.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to