#1 Fri 09 September 2016 20:32
- Ngoulok Madi
- Juste Inscrit !
- Date d'inscription: 31 Jul 2016
- Messages: 3
affichage openstreetmap en fond
bonjour. je suis encore novice dans le webmapping. j'essaie de faire une carte à base de l'exemple de geotribu. j'arrive à afficher l'interface mais le fond de l'application reste rose. comment donc afficher openstreetmap en couche de base . voici mon code
Code:
<html> <head> <title>GeoExt Workshop Application</title> <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"> <link rel="stylesheet" type="text/css" href="geoext/resources/css/popup.css"> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext/ext-all.js"></script> <script src="OpenLayers-2.13.1/OpenLayers.js"></script> <script type="text/javascript" src="geoext/lib/GeoExt.js"></script> <script type="text/javascript"> Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif"; var app, items = [], controls = []; Ext.onReady(function() { app = new Ext.Viewport({ layout: "border", items: items }); }); items.push({ xtype: "gx_mappanel", ref: "mapPanel", region: "center", map: { numZoomLevels: 19, controls: controls }, extent: OpenLayers.Bounds.fromArray([ -122.911, 42.291, -122.787,42.398 ]), layers: [new OpenLayers.Layer.WMS( "Medford", "/geoserver/wms", {layers: "medford"}, {isBaseLayer: false} )] }); controls.push( new OpenLayers.Control.Navigation(), new OpenLayers.Control.Attribution(), new OpenLayers.Control.PanPanel(), new OpenLayers.Control.ZoomPanel() ); </script> </head> <body> </body> </html>
Hors ligne