#1 Tue 17 August 2010 17:18
- j.a.yasser
- Participant occasionnel
- Date d'inscription: 31 Jul 2010
- Messages: 14
aide infobulle
bonjour
j utilise le geoext dans openlayers j ai affiche ma carte dans le web et une couche WFS et je veux afficher un infobulle(par un click) pour récupérer les informations de chaque attribue de la couche
voici mon code:
Code:
var bluemarble = new OpenLayers.Layer.WMS( "bluemarble" ,"http://sigma.openplans.org/geoserver/wms?" ,{layers: 'bluemarble'} ); var City = new OpenLayers.Layer.WFS( "test2", "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tessst/postgisv3.map", {typename: "cities_capital_pt"},{ extractAttributes: true},{layers: "cities_capital_pt"} ); //var cities = new OpenLayers.Layer.GML('point','C:/ms4w/apps/tessst/point.xml'); // [2] - MapPanel var mapUI = new GeoExt.MapPanel({ map: { controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.MousePosition({div: document.getElementById("mouseposition")}), new OpenLayers.Control.PanPanel(), new OpenLayers.Control.ZoomPanel() //,new OpenLayers.Control.SelectFeature(City,{displayClass: "olControlSelect",onSelect: City.even.on}) ] } ,region : 'center' ,title : 'map' ,layers: [bluemarble,City] ,extent: [-5, 35, 15, 55] }); City.events.on({ featureselected: function(e) { if(typeof(popup) != "undefined"){ popup.destroy(); } var content = "<b>"+e.feature.attributes.CNTRY_NAME+ "</b><br /> Lon : "+e.feature.attributes.CNTRY_NAME+ "<br /> Lat : "+e.feature.attributes.CNTRY_NAME; popup = new GeoExt.Popup({ title : 'cities_capital_pt' ,feature : e.feature ,width : 200 ,html : content ,collapsible: true ,anchored : true }); popup.show(); } });
j attend votre aide
merci
Hors ligne