Hi, 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. 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.
Cheers, Chris? -- Christian Mayer, Dipl.-Ing. (FH) GIS-Spezialist & Softwareentwickler meggsimum.de Hauptstraße 165a 67125 Dannstadt-Schauernheim Mail: ch...@meggsimum.de Web: www.meggsimum.de Am 16. Mai 2015 01:59:22 MESZ, schrieb ELKHATTABI Imane <imanek...@gmail.com>: >Thank you so much Chris for replying. >These samples work fine with my wms layer. > >However, I'm using GeoExlporer.js that creates the mapLayout with the >layers and other functionalities. >Is there a way I can define a base map like OSM with this structure : > >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", > "http://localhost:8080/geoserver/wms", { > layers: "dw1:dim_bts_geo", > transparent: true, > format: "image/gif" > }, { > isBaseLayer: false, > buffer: 0, > visibility: false > } > ) > > > ] > }); > >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? > > > >ᐧ > >2015-05-15 20:49 GMT+02:00 Christian Mayer <ch...@meggsimum.de>: > >> Hi, >> >> please check the OpenLayers examples [1] and [2] which show the >> integration of Google Maps or OSM to your map. >> >> Cheers, >> Chris >> >> [1] http://dev.openlayers.org/examples/google.html >> [2] http://dev.openlayers.org/examples/osm.html >> >> >> ELKHATTABI Imane <imanek...@gmail.com> hat am 15. Mai 2015 um 11:37 >> geschrieben: >> >> Hello everyone, >> >> I'd like to know how to define 'Open Street Map' as basemap in the >> function GeoExplorer.js >> >> createLayout:function(){ >> this.map=new OpenLayers.Map({ >> .... >> }); >> >> layers: [ >> >> //=========base layer >> >> new OpenLayers.Layer.WMS( >> "Global Imagery (vmap) [Online]", >> "http://labs.metacarta.com/wms/vmap0", >> { >> layers: "basic", >> transparent: "true", >> format: "image/png" >> }, >> {isBaseLayer: true, visibility: false} >> ), >> new OpenLayers.Layer.WMS("Global Imagery (OpenGeo) [Online]", >> "http://maps.opengeo.org/geowebcache/service/wms", { >> layers: "bluemarble" >> },{ >> //buffer: 0, >> isBaseLayer: true, >> visibility: false >> } >> ) >> ] >> }); >> >> >> Instead of 'Global Imagery' base map, I'd like to use >'OpenStreetMap' or >> 'Google Maps'. >> >> Any hint or help would be highly apreciated. >> Thanks in advance >> ᐧ >> _______________________________________________ >> Users mailing list >> Users@geoext.org >> http://www.geoext.org/cgi-bin/mailman/listinfo/users >> >> >>
_______________________________________________ Users mailing list Users@geoext.org http://www.geoext.org/cgi-bin/mailman/listinfo/users