[OpenLayers-Users] maxExtent problem in map options

manog computer engineer mano3688 at gmail.com
Tue Jan 8 20:40:42 PST 2013


I am using "OpenLayers.Layer.TMS layer" as base layer and wms layer as
overlay layer with "EPSG:3006" and "EPSG:2400" projection.
I am using  maxExtent: new
OpenLayers.Bounds(239930.0,6104843.0,940070.0,7675157.0) in map options.

Base and overlay layers are properly overlaying in openlayers 2.11.
I migrated openlayers from openlayers 2.11 to openlayers 2.12.
But this maxExtent value not supporting in openlayers 2.12.
So, even though the  layers are overlaying on base layers but some
deviation is there between base and overlay layers.

Manually I changed maxExtent bounds value. That time overlay layer and base
layer are closer based on bounds changed value.
But layers are not properly overlaying.

I applied  EPSG:3006 Projected Bounds: 218128.7031, 6126002.9379,
1083427.2970, 7692850.9468 in maxExtend, as recommended in
http://spatialreference.org .
Still the layers are not properly overlaying.


So,What I want to do for this problem?


My sample code:
//Map options
map = new OpenLayers.Map('map', {
                maxExtent: new
OpenLayers.Bounds(239930.0,6104843.0,940070.0,7675157.0),
                resolutions: [3000, 2000, 1500, 1000, 500, 350, 200,100,
50, 25, 10],
                projection: new OpenLayers.Projection('EPSG:3006'),
                allOverlays: true
});

//OpenLayers.Layer.TMS  layer
// for this OpenLayers.Layer.tmsTiles I created seperate js file.
var baseLayer = new OpenLayers.Layer.tmsTiles('Baselayer', [
'/TilesLocation' ],  {
                        units: "m",
                        tileSize: new OpenLayers.Size(256, 256),
                        maxExtent: new OpenLayers.Bounds(0, 0, 25E5, 80E5),
                        resolutions: [3000, 2000, 1500, 1000, 500, 350,
200,100, 50, 25, 10],
                        isBaseLayer: true,
                        visibility: true,
                        type: 'png',
                        projection: 'EPSG:3006',
                        buffer: 0
});
//WMS layer
var overlayLayer =  new OpenLayers.Layer.WMS('OverLayerLayer',
'/geoserver2.2.2/wms', {
                layers: 'layername',
                transparent: true,
                type: 'image/gif',
                exceptions: 'application/vnd.ogc.se_xml'
        }, {
                buffer: 0,
                singleTile: true,
                tileSize: new OpenLayers.Size(512, 512),
                isBaseLayer: false,
                visibility: true
});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130109/6571d167/attachment-0001.html>


More information about the Users mailing list