<div dir="ltr"><span style="font-size:12.8000001907349px">Thank you Christian for replying , </span><div><span style="font-size:12.8000001907349px"><br></span><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Using JS console , I got these bugs :</span><br></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><font color="#3d85c6">1- OpenLayers.js: 1052     -&gt;  Uncaught TypeError: Cannot read property &#39;0&#39; of undefined<br></font></div><div style="font-size:12.8000001907349px"><font color="#3d85c6"><br></font></div><div style="font-size:12.8000001907349px"><font color="#741b47">Line 1052 containing the error  : </font></div><div style="font-size:12.8000001907349px"><font color="#741b47"><br></font></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><font color="#741b47"> return newBounds;},CLASS_NAME:&quot;OpenLayers.Bounds&quot;});OpenLayers.Bounds.fromString=function(str){var bounds=str.split(&quot;,&quot;);return OpenLayers.Bounds.fromArray(bounds);};OpenLayers.Bounds.fromArray=function(bbox){return new OpenLayers.Bounds(parseFloat(bbox[0]),parseFloat(bbox[1]),parseFloat(bbox[2]),parseFloat(bbox[3]));};OpenLayers.Bounds.fromSize=function(size){return new OpenLayers.Bounds(0,size.h,size.w,0);};OpenLayers.Bounds.oppositeQuadrant=function(quadrant){var opp=&quot;&quot;;opp+=(quadrant.charAt(0)==&#39;t&#39;)?&#39;b&#39;:&#39;t&#39;;opp+=(quadrant.charAt(1)==&#39;l&#39;)?&#39;r&#39;:&#39;l&#39;;return opp;};OpenLayers.Lang={code:null,defaultCode:&quot;en&quot;,getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode();}</font><br></div><div style="font-size:12.8000001907349px"><font color="#741b47"><br></font></div><div style="font-size:12.8000001907349px"><font color="#3d85c6"><br></font></div><div style="font-size:12.8000001907349px"><font color="#3d85c6">2- GET <a href="http://localhost:8080/myapp/openlayers/lib/img/blank.gif" target="_blank">http://localhost:8080/myapp/openlayers/lib/img/blank.gif</a> 404 (Introuvable)  </font></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">When I deleted the  &#39;Global Imagery base map&#39; and set my wms layer  in this case as a base map  .it works fine.</div></div><div style="font-size:12.8000001907349px">However , as you mentioned OSM requiers <span style="font-size:12.8000001907349px">EPSG:900913 , but my wms layers are set in EPSG:4326.</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Using the same structure  definition of the basemap layer in the code above  (in  </span><span style="font-size:12.8000001907349px">GeoExlporer.js) </span><span style="font-size:12.8000001907349px">, Is there a way to reproject all the layers to 4326 and still work with OSM?</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Thanks in advance</span></div><div hspace="streak-pt-mark" style="max-height:1px"><img style="width:0px; max-height:0px;" src="https://mailfoogae.appspot.com/t?sender=aaW1hbmVraHRiQGdtYWlsLmNvbQ%3D%3D&amp;type=zerocontent&amp;guid=013390e3-36ea-471c-a3b6-8bf6e7b6fea0"><font color="#ffffff" size="1">ᐧ</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-18 8:41 GMT+02:00 Christian Mayer <span dir="ltr">&lt;<a href="mailto:chris@meggsimum.de" target="_blank">chris@meggsimum.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,<br>
<br>
I guess you have a projection issue since the default of an OpenLayers map is EPSG:4326 but you need EPSG:900913 to use OSM. Be sure to set the projection property on your map.<br>
Do you have any error messages in your console (hitting F12 key in your browser)? Please add them to your posts, so it is easier to check what your problem could be.<br>
<br>
Cheers,<br>
Chris?<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Christian Mayer, Dipl.-Ing. (FH)<br>
GIS-Spezialist &amp; Softwareentwickler<br>
<br>
<a href="http://meggsimum.de" target="_blank">meggsimum.de</a><br>
Hauptstraße 165a<br>
67125 Dannstadt-Schauernheim<br>
Mail: <a href="mailto:chris@meggsimum.de" target="_blank">chris@meggsimum.de</a><br>
Web: <a href="http://www.meggsimum.de" target="_blank">www.meggsimum.de</a></font></span><div><div class="h5"><br><br><div class="gmail_quote">Am 16. Mai 2015 01:59:22 MESZ, schrieb ELKHATTABI Imane &lt;<a href="mailto:imanekhtb@gmail.com" target="_blank">imanekhtb@gmail.com</a>&gt;:<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Thank you so much Chris for replying.<div>These samples work  fine with my wms layer.</div><div><br></div><div>However, I&#39;m using GeoExlporer.js that creates the mapLayout with the layers and other functionalities.</div><div>Is there a way I can define a base map like OSM with this structure :</div><div><br></div><div><div style="font-size:12.8000001907349px"><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:12px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;word-wrap:normal;color:rgb(51,51,51);line-height:18px;background-color:rgb(238,238,238)"><code>this.mapPanel=new GeoExt.MapPanel({
            layout:&quot;anchor&quot;,border:true,region:&quot;center&quot;,
            map:this.map,
            center:mapConfig.center&amp;&amp;new OpenLayers.LonLat(mapConfig.center[0],mapConfig.center[1]),
            zoom:mapConfig.zoom,
            items:[{
                xtype:&quot;gx_zoomslider&quot;,
                vertical:true,height:100,
                plugins:new GeoExt.ZoomSliderTip({template:&quot;&lt;div&gt;Zoom Level: {zoom}&lt;/div&gt;&quot;})},
                this.createMapOverlay()
            ],
            layers: [


//====base layer=====
                    new OpenLayers.Layer.OSM(&quot;OpenLayers&quot;),
//=====overlays=====

                new OpenLayers.Layer.WMS(&quot;dim_bts_geo&quot;,
                    &quot;<a href="http://localhost:8080/geoserver/wms" target="_blank">http://localhost:8080/geoserver/wms</a>&quot;, {
                        layers: &quot;dw1:dim_bts_geo&quot;,
                        transparent: true,
                        format: &quot;image/gif&quot;
                    }, {
                        isBaseLayer: false,
                        buffer: 0,
                        visibility: false
                    }
                )


            ]
        });</code></pre><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:12px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;word-wrap:normal;line-height:18px"><span style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif;font-size:14px;white-space:normal;background-color:rgb(255,255,255)"><font color="#000000">Now that I replaced the basemap by  OSM  base layer . No map component is showing anymore. the page is just empty. Is there something wrong with the OSM  basemap definition?</font></span><font color="#333333"><br></font></pre><pre><span style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif;font-size:14px;white-space:normal;background-color:rgb(255,255,255)"><font color="#000000"><br></font></span></pre><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:12px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;word-wrap:normal;line-height:18px"><br></pre></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img style="width:0px;max-height:0px" src="https://mailfoogae.appspot.com/t?sender=aaW1hbmVraHRiQGdtYWlsLmNvbQ%3D%3D&amp;type=zerocontent&amp;guid=db68eb2b-3b2f-41a7-a90d-e932796d5ced"><font color="#ffffff" size="1">ᐧ</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-15 20:49 GMT+02:00 Christian Mayer <span dir="ltr">&lt;<a href="mailto:chris@meggsimum.de" target="_blank">chris@meggsimum.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
    
 
  
 
 <div>
 
  <div>
   Hi,
  </div> 
  <div>
    
  </div> 
  <div>
   please check the OpenLayers examples [1] and [2] which show the integration of Google Maps or  OSM to your map.
  </div> 
  <div>
    
  </div> 
  <div>
   Cheers,
  </div> 
  <div>
   Chris
  </div> 
  <div>
    
  </div> 
  <div>
   [1] <a href="http://dev.openlayers.org/examples/google.html" target="_blank">http://dev.openlayers.org/examples/google.html</a>
  </div> 
  <div>
   [2] <a href="http://dev.openlayers.org/examples/osm.html" target="_blank">http://dev.openlayers.org/examples/osm.html</a>
  </div> 
  <div>
    
  </div> 
  <div>
    
  </div> 
  <div>
   ELKHATTABI Imane &lt;<a href="mailto:imanekhtb@gmail.com" target="_blank">imanekhtb@gmail.com</a>&gt; hat am 15. Mai 2015 um 11:37 geschrieben:
  </div> 
  <div><div><div>
   <br> 
   <div dir="ltr">
    Hello everyone, 
    <div>
      
    </div> 
    <div>
     I&#39;d like to know how to define &#39;Open Street Map&#39; as basemap in the function GeoExplorer.js
    </div> 
    <div>
      
    </div> 
    <div> 
     <div style="font-size:12.8000001907349px"> 
      <div>
       <span style="color:#0b5394">createLayout:function(){</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>this.map=new OpenLayers.Map({</span>
      </div> 
      <div>
       <span><span style="color:#0b5394"> ....</span></span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>});</span>
      </div> 
      <div>
        
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>layers: [</span>
      </div> 
      <div>
        
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>//=========base layer</span>
      </div> 
      <div>
        
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>new OpenLayers.Layer.WMS(</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>&quot;Global Imagery (vmap) [Online]&quot;,</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>&quot;<a href="http://labs.metacarta.com/wms/vmap0" target="_blank">http://labs.metacarta.com/wms/vmap0</a>&quot;,</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>{</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>layers: &quot;basic&quot;,</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>transparent: &quot;true&quot;,</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>format: &quot;image/png&quot;</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>},</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>{isBaseLayer: true, visibility: false}</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>),</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>new OpenLayers.Layer.WMS(&quot;Global Imagery (OpenGeo) [Online]&quot;,</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>&quot;<a href="http://maps.opengeo.org/geowebcache/service/wms" target="_blank">http://maps.opengeo.org/geowebcache/service/wms</a>&quot;, {</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>layers: &quot;bluemarble&quot;</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>},{</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>//buffer: 0,</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>isBaseLayer: true,</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>visibility: false</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>}</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>)</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>]</span>
      </div> 
      <div>
       <span style="color:#0b5394"><span> </span>});</span>
      </div> 
      <div>
       <span style="color:#0b5394"> </span>
      </div> 
      <div>
       <span style="color:#0b5394"> </span>
      </div> 
      <div>
       <span style="font-size:12.8000001907349px">Instead of &#39;Global Imagery&#39; base map, I&#39;d like to use &#39;OpenStreetMap&#39; or &#39;Google Maps&#39;.</span>
       <span style="color:#0b5394"><br></span>
      </div> 
      <div>
       <span style="font-size:12.8000001907349px"> </span>
      </div> 
      <div>
       <span style="font-size:12.8000001907349px">Any hint or help would be highly apreciated.</span>
      </div> 
      <div>
       <span style="font-size:12.8000001907349px">Thanks in advance</span>
      </div> 
     </div> 
    </div> 
    <div style="max-height:1px">
     <img src="https://mailfoogae.appspot.com/t?sender=aaW1hbmVraHRiQGdtYWlsLmNvbQ%3D%3D&amp;type=zerocontent&amp;guid=768ef2c0-3c9c-4441-bfa0-f731e6a89a27" border="0">
     <span style="color:#ffffff;font-size:xx-small">ᐧ</span>
    </div> 
   </div></div></div> _______________________________________________
   <br>Users mailing list
   <br><a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a>
   <br><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a>
  </div> 
  <div>
   <br> 
  </div>
 
</div></blockquote></div><br></div>
</blockquote></div></div></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>