<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-AT link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Erwin,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>my source code looks like this:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> var proj4326 = new OpenLayers.Projection("EPSG:4326");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> var projmerc = new OpenLayers.Projection("EPSG:900913");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>map = new OpenLayers.Map({<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> projection: projmerc,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> displayProjection: proj4326,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> units: "m",<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> numZoomLevels: 19,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> maxResolution: 156543.0339,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> maxExtent: new OpenLayers.Bounds(-20037508, -20037508,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> 20037508, 20037508.34),<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> controls: []<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>});<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> var lonlatEurope = new OpenLayers.LonLat(12.0849609375, 47.79839667295524);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> lonlatEurope.transform(proj4326, projmerc);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> var osm = new OpenLayers.Layer.OSM.Mapnik("OSM Mapnik", {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> transparent: true<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> },{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> visibility: true<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> )<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> layers.push(osm);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> //Layer is in WGS 84 projection<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>layers.push(new OpenLayers.Layer.WMS("ThermoMap Countries", geoserverURL, {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> layers: "ThermoMap:ThermoMap_Partners_Countries",<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> transparent: true,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> format: 'image/png'<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> }, {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> singleTile: true,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> isBaseLayer: false,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> visibility: false<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> }<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> ));<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> map.addLayers(layers);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> map.setCenter(lonlatEurope, 4, true, true);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Lucia<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal style='margin-bottom:1.0pt'><b><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:#365F91'>Dipl.-Geogr. Lucia Morper-Busch</span></b><b><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:#1F497D'> | </span></b><b><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:#C00000'>Researcher</span></b><b><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p></o:p></span></b></p><p class=MsoNormal style='margin-bottom:1.0pt'><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:gray'>University of Salzburg | Centre for Geoinformatics - Z_GIS<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:1.0pt'><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:gray'>Schillerstr.30 | Techno-Z, Block 15, 3rd floor | 5020 Salzburg, Austria<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:gray'>Phone +43 (0)662 8044 5298 | Fax +43 (0)662 8044 5260<o:p></o:p></span></p><p class=MsoNormal><b><i><span lang=EN-US style='font-size:8.0pt;font-family:"Verdana","sans-serif";color:gray'>> <a href="http://www.zgis.at/research"><span style='color:gray;text-decoration:none'>Z_GIS…experts for the spatial view</span></a><o:p></o:p></span></i></b></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> users-bounces@geoext.org [mailto:users-bounces@geoext.org] <b>Im Auftrag von </b>Erwin Sevens<br><b>Gesendet:</b> Dienstag, 15. Februar 2011 10:59<br><b>An:</b> users@geoext.org<br><b>Betreff:</b> [Users] Problem showing WMS in Mercator projection<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:black'>Hi,<br><br>I am trying to combine WMS-layers with the Openstreet Map as background.<br>The WMS-layers disapear as soon as I zoom in.<br>When working in geographic projection, I manage to get the WMS to show on a background layer.<br>I know it is possible as in the opengeo suite, it is possible to do it. Unfortunately, I cannot see how they did it.<br>I have added two simple examples with layers available on the net and the javascripts refering to the online sources.<br><br>Can somebody explain me what I do wrong?<br><br>A working simple example with the default projection:<br>====================================<br><html><br><head><br><br><title> A working GeoExt Map </title><br><script src="<a href="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js">http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js</a>" type="text/javascript"></script><br><script src="<a href="http://extjs.cachefly.net/ext-3.2.1/ext-all.js">http://extjs.cachefly.net/ext-3.2.1/ext-all.js</a>" type="text/javascript"></script><br><link rel="stylesheet" type="text/css" href="<a href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css">http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css</a>"></link><br><script src="<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>" type="text/javascript"></script><br><script src="<a href="http://api.geoext.org/1.0/script/GeoExt.js">http://api.geoext.org/1.0/script/GeoExt.js</a>" type="text/javascript"></script><br><link rel="stylesheet" type="text/css" href="<a href="http://api.geoext.org/1.0/resources/css/geoext-all-debug.css">http://api.geoext.org/1.0/resources/css/geoext-all-debug.css</a>"></link><br><br><script type="text/javascript"><br> Ext.onReady(function() {<br> <br> var map = new OpenLayers.Map({allOverlays: true});<br> var kansas = new OpenLayers.LonLat(-99, 39);<br><br> var usa = new OpenLayers.Layer.WMS(<br> "usa", "<a href="http://demo.opengeo.org/geoserver/wms">http://demo.opengeo.org/geoserver/wms</a>",<br> {<br> height: '330',<br> width: '680',<br> layers: 'nurc:Img_Sample',<br> styles: '',<br> srs: 'EPSG:4326',<br> format: 'image/png'<br> },<br> {singleTile: true, ratio: 1} <br> ); <br> var layer = new OpenLayers.Layer.WMS(<br> "USA pop",<br> "<a href="http://demo.opengeo.org/geoserver/wms">http://demo.opengeo.org/geoserver/wms</a>",<br> {layers: "topp:states"},<br> {opacity: 0.5}<br> ); <br><br> map.addLayer(usa);<br> map.addLayer(layer);<br> <br> new GeoExt.MapPanel({<br> renderTo: 'gxmap',<br> height: 400,<br> width: 600,<br> map: map,<br> center: kansas,<br> zoom: 4,<br> title: 'A working GeoExt Map, default projection'<br> });<br> });<br></script><br></head><br><body><br><div id="gxmap"></div><br></body><br></html><br><br>============================================<br>the not working example with mercator projection<br>============================================<br><br><html><br><head><br><br><title> A WMS failing GeoExt Map </title><br><script src="<a href="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js">http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js</a>" type="text/javascript"></script><br><script src="<a href="http://extjs.cachefly.net/ext-3.2.1/ext-all.js">http://extjs.cachefly.net/ext-3.2.1/ext-all.js</a>" type="text/javascript"></script><br><link rel="stylesheet" type="text/css" href="<a href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css">http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css</a>"></link><br><script src="<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>" type="text/javascript"></script><br><script src="<a href="http://api.geoext.org/1.0/script/GeoExt.js">http://api.geoext.org/1.0/script/GeoExt.js</a>" type="text/javascript"></script><br><link rel="stylesheet" type="text/css" href="<a href="http://api.geoext.org/1.0/resources/css/geoext-all-debug.css">http://api.geoext.org/1.0/resources/css/geoext-all-debug.css</a>"></link><br><br><script type="text/javascript"><br> Ext.onReady(function() {<br> <br> var geographic = new OpenLayers.Projection("EPSG:4326");<br> var mercator = new OpenLayers.Projection("EPSG:900913");<br><br> var map = new OpenLayers.Map({allOverlays: true,<br> projection: "EPSG:900913",<br> units: "m"<br> });<br> var kansas = new OpenLayers.LonLat(-99, 39).transform(geographic, mercator);<br><br> var osm = new OpenLayers.Layer.OSM(); <br> var layer = new OpenLayers.Layer.WMS(<br> "USA pop",<br> "<a href="http://demo.opengeo.org/geoserver/wms">http://demo.opengeo.org/geoserver/wms</a>",<br> {layers: "topp:states"},<br> {opacity: 0.5}<br> ); <br><br> map.addLayer(osm);<br> map.addLayer(layer);<br> <br> new GeoExt.MapPanel({<br> renderTo: 'gxmap',<br> height: 400,<br> width: 600,<br> map: map,<br> center: kansas,<br> zoom: 4,<br> title: 'A WMS failing GeoExt Map, Mercator projection'<br> });<br> });<br></script><br></head><br><body><br><div id="gxmap"></div><br></body><br></html><br><br> <br>Erwin Sevens | OVAM<br><a href="http://www.ovam.be">http://www.ovam.be</a><o:p></o:p></span></p></div></div></body></html>