I am using "OpenLayers.Layer.TMS layer" as base layer and wms layer as overlay layer with "EPSG:3006" and "EPSG:2400" projection.<br>I am using maxExtent: new OpenLayers.Bounds(239930.0,6104843.0,940070.0,7675157.0) in map options.<br>
<br>Base and overlay layers are properly overlaying in openlayers 2.11.<br>I migrated openlayers from openlayers 2.11 to openlayers 2.12.<br>But this maxExtent value not supporting in openlayers 2.12.<br>So, even though the layers are overlaying on base layers but some deviation is there between base and overlay layers.<br>
<br>Manually I changed maxExtent bounds value. That time overlay layer and base layer are closer based on bounds changed value.<br>But layers are not properly overlaying.<br><br>I applied EPSG:3006 Projected Bounds: 218128.7031, 6126002.9379, 1083427.2970, 7692850.9468 in maxExtend, as recommended in <a href="http://spatialreference.org">http://spatialreference.org</a> .<br>
Still the layers are not properly overlaying.<br><br><br>So,What I want to do for this problem?<br><br><br>My sample code:<br>//Map options<br>map = new OpenLayers.Map('map', {<br> maxExtent: new OpenLayers.Bounds(239930.0,6104843.0,940070.0,7675157.0),<br>
resolutions: [3000, 2000, 1500, 1000, 500, 350, 200,100, 50, 25, 10],<br> projection: new OpenLayers.Projection('EPSG:3006'),<br> allOverlays: true<br>});<br><br>//OpenLayers.Layer.TMS layer<br>
// for this OpenLayers.Layer.tmsTiles I created seperate js file.<br>var baseLayer = new OpenLayers.Layer.tmsTiles('Baselayer', [ '/TilesLocation' ], {<br> units: "m",<br>
tileSize: new OpenLayers.Size(256, 256),<br> maxExtent: new OpenLayers.Bounds(0, 0, 25E5, 80E5),<br> resolutions: [3000, 2000, 1500, 1000, 500, 350, 200,100, 50, 25, 10],<br>
isBaseLayer: true,<br> visibility: true,<br> type: 'png',<br> projection: 'EPSG:3006',<br> buffer: 0<br>
});<br>//WMS layer<br>var overlayLayer = new OpenLayers.Layer.WMS('OverLayerLayer', '/geoserver2.2.2/wms', {<br> layers: 'layername',<br> transparent: true,<br> type: 'image/gif',<br>
exceptions: 'application/vnd.ogc.se_xml'<br> }, {<br> buffer: 0,<br> singleTile: true,<br> tileSize: new OpenLayers.Size(512, 512),<br> isBaseLayer: false,<br>
visibility: true<br>}); <br>