Pages: 1
- Sujet précédent - Probleme de POP up msWMSFeatureInfo(): WMS server error. Requested lay - Sujet suivant
#1 Sun 29 July 2012 15:56
- diouckk
- Juste Inscrit !
- Date d'inscription: 30 Apr 2012
- Messages: 5
Probleme de POP up msWMSFeatureInfo(): WMS server error. Requested lay
Bonjour
Je voudrai affiché un pop up mais quand j'interroge la carte ca repond
msWMSFeatureInfo(): WMS server error. Requested layer(s) are not queryable.
Est ce que quelqu'un pourrait m 'aider a resoudre le probleme
</head>
<script type="text/javascript" src="http://localhost/lib/OpenLayers-2.11/OpenLayers.js"></script>
<script type="text/javascript">
function init() {
var map, ol_wms; //instanciation du constructeur
var bounds = new OpenLayers.Bounds(95.009331,-11.004850,133.073410,8.726957);
map = new OpenLayers.Map('map', { controls:
[new OpenLayers.Control.MouseDefaults()],
projection: new OpenLayers.Projection("EPSG:4326"),
maxExtent: new OpenLayers.Bounds(95.009331,-11.004850,133.073410,8.726957),
units: "km",
maxresolution:"auto"
});
//Ajout des options graph, zoom + apercu
map.addControl(new OpenLayers.Control.OverviewMap()); //Aperçu
map.addControl(new OpenLayers.Control.Navigation());
map.addControl(new OpenLayers.Control.Scale()); //Echelle numerique
map.addControl(new OpenLayers.Control.LayerSwitcher()); //Boite de gestion des couches
map.addControl(new OpenLayers.Control.ScaleLine()); //Echelle graphique
map.addControl(new OpenLayers.Control.MousePosition({div: document.getElementById("mouseposition")})); //ajout des coordonnées de la position du curseur
//Choix des couches
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
//ajout des couches a la carte
map.addLayers([ol_wms]);
var Admin_Indonesie = new OpenLayers.Layer.WMS("Admin_Indonesie",
"http://localhost/cgi-bin/mapserv?map=/var/www/mapserver/mapfile/tuto.map",
{layers: "Admin_Indonesie",transparent: true,format: "image/png"}
);
map.addLayer(Admin_Indonesie);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://localhost/cgi-bin/mapserv?map=/var/www/mapserver/mapfile/tuto.map",
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
map.addPopup(new OpenLayers.Popup.FramedCloud(
"chicken",
map.getLonLatFromPixel(event.xy),
null,
event.text,
null,
true
));
}
}
});
map.addControl(info);
info.activate();
//On zoom au max
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()" >
<div id="map"></div>
</body>
</html>
Dernière modification par diouckk (Mon 30 July 2012 13:06)
Hors ligne
Pages: 1
- Sujet précédent - Probleme de POP up msWMSFeatureInfo(): WMS server error. Requested lay - Sujet suivant