I have written the following code using Openlayers:
<script type="text/javascript">
<!-- DEFINE PROXY.CGI URL -->
OpenLayers.ProxyHost = "http://localhost/cgi-bin/proxy.cgi?url=";
<!-- DEFINE GLOBAL VARIABLES -->
var map,wms, control;
<!-- DEFINE FUNCTION INIT -->
function init(){
map = new OpenLayers.Map('map',{}); // define map
wms = new OpenLayers.Layer.WMS( "OpenLayers WMS","http://ift.tt/PmQf9E", {layers: 'basic'} ); // define map layer
strategy = new OpenLayers.Strategy.Cluster();
<!-- OVERLAY WFS LAYER WITH KOMVUS FROM GEOSERVER -->
wfs_layer_komvoi = new OpenLayers.Layer.Vector("Κόμβοι", {
strategies: [strategy],
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://localhost:8080/geoserver/wfs",
featurePrefix: "rural", //workspace from geoserver
featureType: "komvoipart", //layer name from geoserver
featureNS : "http://ift.tt/1t6n1TB", //namespace from geoserver
styles: "point"
})
})
<!-- ADD LAYERS ETC -->
map.addLayers([wms,wfs_layer_komvoi]);
map.zoomToExtent( new OpenLayers.Bounds(36.190737, 35.353912,35.150577, 50.274810));
} // end function init()
When I use as a strategy: Fixed the code gets some features from geoserver and displays them on the map without any problem. When I try to use a strategy: Cluster (as shown in the code) I get nothing back. I only see the map but no points. I checked for errors with firebug but there is nothing. Not even the POST request to the server.
What am I missing here???
Aucun commentaire:
Enregistrer un commentaire