[Users] BaseMap Definition in GeoExplorer

Christian Mayer chris at meggsimum.de
Mon May 18 08:41:33 CEST 2015


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: chris at meggsimum.de
Web: www.meggsimum.de

Am 16. Mai 2015 01:59:22 MESZ, schrieb ELKHATTABI Imane <imanekhtb at 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 <chris at 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 <imanekhtb at 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 at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20150518/c3a54304/attachment.htm 


More information about the Users mailing list