<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 -> Uncaught TypeError: Cannot read property '0' 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:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(str){var bounds=str.split(",");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="";opp+=(quadrant.charAt(0)=='t')?'b':'t';opp+=(quadrant.charAt(1)=='l')?'r':'l';return opp;};OpenLayers.Lang={code:null,defaultCode:"en",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 'Global Imagery base map' 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&type=zerocontent&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"><<a href="mailto:chris@meggsimum.de" target="_blank">chris@meggsimum.de</a>></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 & 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 <<a href="mailto:imanekhtb@gmail.com" target="_blank">imanekhtb@gmail.com</a>>:<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'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,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',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:"anchor",border:true,region:"center",
map:this.map,
center:mapConfig.center&&new OpenLayers.LonLat(mapConfig.center[0],mapConfig.center[1]),
zoom:mapConfig.zoom,
items:[{
xtype:"gx_zoomslider",
vertical:true,height:100,
plugins:new GeoExt.ZoomSliderTip({template:"<div>Zoom Level: {zoom}</div>"})},
this.createMapOverlay()
],
layers: [
//====base layer=====
new OpenLayers.Layer.OSM("OpenLayers"),
//=====overlays=====
new OpenLayers.Layer.WMS("dim_bts_geo",
"<a href="http://localhost:8080/geoserver/wms" target="_blank">http://localhost:8080/geoserver/wms</a>", {
layers: "dw1:dim_bts_geo",
transparent: true,
format: "image/gif"
}, {
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,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;word-wrap:normal;line-height:18px"><span style="font-family:'Helvetica Neue',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:'Helvetica Neue',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,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',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&type=zerocontent&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"><<a href="mailto:chris@meggsimum.de" target="_blank">chris@meggsimum.de</a>></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 <<a href="mailto:imanekhtb@gmail.com" target="_blank">imanekhtb@gmail.com</a>> hat am 15. Mai 2015 um 11:37 geschrieben:
</div>
<div><div><div>
<br>
<div dir="ltr">
Hello everyone,
<div>
</div>
<div>
I'd like to know how to define 'Open Street Map' 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>"Global Imagery (vmap) [Online]",</span>
</div>
<div>
<span style="color:#0b5394"><span> </span>"<a href="http://labs.metacarta.com/wms/vmap0" target="_blank">http://labs.metacarta.com/wms/vmap0</a>",</span>
</div>
<div>
<span style="color:#0b5394"><span> </span>{</span>
</div>
<div>
<span style="color:#0b5394"><span> </span>layers: "basic",</span>
</div>
<div>
<span style="color:#0b5394"><span> </span>transparent: "true",</span>
</div>
<div>
<span style="color:#0b5394"><span> </span>format: "image/png"</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("Global Imagery (OpenGeo) [Online]",</span>
</div>
<div>
<span style="color:#0b5394"><span> </span>"<a href="http://maps.opengeo.org/geowebcache/service/wms" target="_blank">http://maps.opengeo.org/geowebcache/service/wms</a>", {</span>
</div>
<div>
<span style="color:#0b5394"><span> </span>layers: "bluemarble"</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 'Global Imagery' base map, I'd like to use 'OpenStreetMap' or 'Google Maps'.</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&type=zerocontent&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>