[OpenLayers-Users] Having Trouble with displaying features
George Silva
georger.silva at gmail.com
Mon Mar 9 22:48:09 EDT 2009
Hello everyone,
I'm quite a novice OL user. I'm using Geoserver with PostGIS layers, and
i would like to display them with OL. In the "Demo" session of GeoServer
admin page i can see my FeatureType and GeoServer correctly renders a
test page of this FeatureType for me.
However, when i'm writing my own code, the map gets displayed, but its
not using the simbology i selected with GeoServer. Here is the code:
*<script
src="http://localhost:8080/geoserver/openlayers/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init() {
map = new OpenLayers.Map('map');
var log = new OpenLayers.Layer.WFS(
"Logradouros",
"http://localhost:8080/geoserver/wfs",
{typename: "sigma:logradouros"}
);
map.addLayers([log]);
map.zoomToMaxExtent();
}
</script>
*My question is: is there anything wrong with this code? I wrote it
based on examples found on the web such as:
http://workshops.opengeo.org/openlayers/intro/doc/en/layers.html
Do i need to specify to OpenLayers exactly what simbology is going to be
used? All i get is blank map.
Thanks for all the help in advance.
George
More information about the Users
mailing list