getExtent() is always in the projection of the units of the current baseLayer.
BaseLayers like Google, OSM, etc. are always in EPSG:900913 (assuming you're
using spherical mercator, which you generally should be).
In the case of:
"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?"
These look to be units of degrees, is my guess, but it's hard to know without
more information about your projection. Note that the map projection has
*no* impact on the projection of the baseLayer if you set the projection
on the base layer -- Map() creation projection options are used as defaults
if options are not provided later.
The latter looks like EPSG:900913 (meters).
Regarding your weird projection output -- this is because the first
sample is very odd. It looks as if you have a map with a weird maxResolution
(or a *very* large monitor -- something like 2000px across) and as such are
getting coordinates outside the world, which then can't be reprojected.
Without more information on how you're configuring your map, I don't have any
way to provide more information.
-- Chris
On Jan 17, 2011, at 7:33 PM, ext Roy Hyunjin Han wrote:
> On 01/17/2011 07:15 PM, Roy Hyunjin Han wrote:
>> 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
>>>
>>
>
> Here are some more clues.
>
> When the OpenLayers map projection is 4326, the results are similar to
> Polymaps.
> >>> map.getExtent()
> left-bottom=(-140.625,-95.625) right-top=(219.375,84.375) { left=-140.625,
> bottom=-95.625, more...}
> >>> map.getMaxExtent()
> left-bottom=(-180,-90) right-top=(180,90) { left=-180, bottom=-90, more...}
>
> When the OpenLayers map projection is 3857, the results look like the second
> option.
> >>> mapOL.getMaxExtent()
> left-bottom=(-20037508.3392,-20037508.3392)
> right-top=(20037508.3392,20037508.3392) { left=-20037508.3392,
> bottom=-20037508.3392, more...}
> >>> mapOL.getExtent()
> left-bottom=(-15321879.52398,-997903.53949725)
> right-top=(-2935411.9666423,9040418.5093402) { left=-15321879.52398,
> bottom=-997903.53949725, more...}
>
> It seems that if the layer projection and map projection are different, then
> the *bbox* calculated is a nonsensical series of numbers.
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users