[OpenLayers-Users] maxResolution change
Schuyler Erle
sderle at metacarta.com
Mon Jun 19 16:11:17 CDT 2006
* On 19-Jun-2006 at 3:14PM EDT, Chris Holmes said:
>
> > * Matches the Google Maps zoom levels, making it easier to convert
> > Google Maps style applications to OpenLayers.
>
> Interesting. Does it match it at the levels all the way zoomed out? My
> understanding is that Gmaps uses Mercator for the first five or so zoom
> levels...
Well, we haven't gotten that far yet. It's an interesting
consideration if true. I'd had the impression they used Mercator all
the way down.
> so for getting gmaps working with GeoServer we have it request
> EPSG:41001 (mercator) when zoomed out, and EPSG:4326 (lat/long) when
> zoomed in. Is openlayers doing something similar? Or just using
> 4326 the whole time?
That's even more interesting. Where did you get EPSG 41001 from? It
doesn't appear in the EPSG list that ships with PROJ.4.
The way that projections work in OL right now is as follows: By
default, the projection used is EPSG 4326, longitude/latitude, with
the WGS-84 ellipsoid and datum. Consequently the default maxExtent is
(-180, -90, 180, 90).
If you want to use a different projection in OpenLayers, you need to
provide three things to the OpenLayers.Map constructor:
1. projection: "EPSG:2805" (or other OGC WMS compatible SRS string)
2. maxExtent: new OpenLayers.Bounds(minx, miny, maxx, maxy)
3. maxResolution: ... (which can be "null" if you want the whole
map always shown at zoom level 0)
... and optionally...
4. maxZoomLevel: 8 (or other integer, if the default of 16 is too
many or not enough)
Adding support for non-WMS basemaps means that the Map class may have
to support having the projection changed out from under it. While this
presents little or no problem for displaying point markers -- since
the basemap should always be able to tell us what pixel location
matches a geographic coordinate -- but this will pose problems for
displaying WMS overlays that don't support Mercator projection. Not
sure what else can be done about that, though. Suggestions welcome.
SDE
More information about the Users
mailing list