[OpenLayers-Users] Changing Resolution in Spherical Mercator

Arnd Wippermann arnd.wippermann at web.de
Fri Nov 16 18:44:59 EST 2007


Hi,
 
if you want to use SphericalMercator with Google Maps, then you can only use
the resolutions of Google Maps. They deliver their maps only in this
resolutions.
 
Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/



  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Linda Rawson
Gesendet: Freitag, 16. November 2007 15:18
An: users at openlayers.org
Betreff: [OpenLayers-Users] Changing Resolution in Spherical Mercator


I am using the following to define my map:
 
options = {
    projection: "EPSG:900913",
    units: "m",
    maxResolution: 156543.0339,
    numZoomLevels: 18,
    maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                     20037508, 20037508.34)
};
 
map = new OpenLayers.Map('map',options);

Then my layer:

var sat = new OpenLayers.Layer.Google(
                "Google",
                {'sphericalMercator': true}
    );

What the sphericalMercator true does is run the 

initMercatorParameters: function() {
        // set up properties for Mercator - assume EPSG:900913
        this.RESOLUTIONS = [];
        var maxResolution = 156543.0339;
        for(var zoom=0; zoom<= this.MAX_ZOOM_LEVEL; ++zoom) {
            this.RESOLUTIONS[zoom] = maxResolution / Math.pow(2, zoom);
        }
        this.units = "m";
        this.projection = "EPSG:900913";
    }, 

The maxResolution of 156543.0339 is based on (20037508.34 + 20037508) / 256.

I need a different Resolution but I still want the forward and inverse
mercator functions to work.  Where are all the different places to change
the resolution?  I need it based on a tile that is not 256 in size.  I have
tried changing this in initMercatorParameters, the map, but It still does
not seem to play nice. 

Thanks,

Linda Rawson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071117/8fb3f5a1/attachment.html


More information about the Users mailing list