#1 Wed 30 March 2011 14:19
- alexta
- Juste Inscrit !
- Date d'inscription: 30 Mar 2011
- Messages: 1
Problème Bounds Is null Mapserver Openlayers
Bonjour,
voilà j'ai un problème que je n'arrive pas à résoudre :
sur firebug ça me met bounds is null
Code:
<html>
<head>
<style>
#panel {
right: 0px;
height: 30px;
width: 200px;
}
#panel div {
float: left;
margin: 5px;
}
</style>
<title>OpenLayers Example</title>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
<div id="mouseposition"></div>
<div id="panel"></div>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
map.addControl (new OpenLayers.Control.MousePosition({
div: document.getElementById("mouseposition")
}));
var layer = new OpenLayers.Layer.WFS(
"wfs", "http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/test/MapFile/indonesie_pop.map&",
{typename: 'Admin_Indonesie'},
{ extractAttributes: true}
);
map.addLayer(layer);
var overview = new OpenLayers.Control.OverviewMap();
map.addControl(overview);
var panel = new OpenLayers.Control.Panel({
div: document.getElementById("panel")
});
var history = new OpenLayers.Control.NavigationHistory();
map.addControl(history);
panel.addControls([history.next, history.previous]);
map.addControl(panel)
map.zoomToMaxExtent();
</script>
</body>
</html>et le mapfile :
Code:
MAP
SIZE 1000 500
EXTENT 94.0000 -9.0048 131.000 4
UNITS METERS
IMAGECOLOR 255 255 255
SHAPEPATH "C:/ms4w/Apache/htdocs/test/MapFile/"
WEB
IMAGEPATH "C:/ms4w/Apache/htdocs/test/MapFile/MapFile/tmp"
IMAGEURL "tmp/"
METADATA
"wfs_title" "dep"
"wfs_onlineresource" "http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/test/MapFile/indonesie_pop.map" ## Recommended
"wfs_srs" "epsg:4326" ## Recommended
END
END
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END
#==============================================================================
# Layer Administratif
#==============================================================================
LAYER
NAME Admin_Indonesie
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "C:/ms4w/Apache/htdocs/test/MapFile/indonesie_surface.tab"
METADATA
### WFS
"wfs_title" "departement"
"gml_featureid" "NAME"
"gml_include_items" "all"
END
PROJECTION
"init=epsg:4326" ##recommended
END
DUMP TRUE
TYPE LINE
CLASS
STYLE
COLOR 0 0 0
OUTLINECOLOR 255 255 255
END
END
END
ENDSi quelqu'un pourrait m'aider ça serait sympa ! Merci d'avance ![]()
@+
Dernière modification par alexta (Wed 30 March 2011 14:23)
Hors ligne


