I hope I can get same help from here. I started to put together a leaflet map, please see here: http://gis.xyz/leaflet2.html I want to show my postgis point (uk based) features on this map with cluster method. The points are already on the map (I used geoserver- jsonp), but I cannot figure out how can I add to the layer to the cluster layer. I also added a markercluster example to the script, this is how I would like to see my layer. It would be great if someone would help me to answer this question.
var owsrootUrl = 'http://217.8.255.188:8080/geoserver/opengeo/ows';
var defaultParameters = {
service : 'WFS',
version : '2.0',
request : 'GetFeature',
typeName : 'opengeo:evernote_geom',
outputFormat : 'text/javascript',
format_options : 'callback:getJson',
SrsName : 'EPSG:4326'
};
var parameters = L.Util.extend(defaultParameters);
var URL = owsrootUrl + L.Util.getParamString(parameters);
var WFSLayer = null;
var ajax = $.ajax({
url : URL,
dataType : 'jsonp',
jsonpCallback : 'getJson',
success : function (response) {
WFSLayer = L.geoJson(response, {
style: function (feature) {
return {
stroke: false,
fillColor: 'FFFFFF',
fillOpacity: 0
};
},
onEachFeature: function (feature, layer) {
popupOptions = {maxWidth: 600};
layer.bindPopup('<h4>'+feature.properties.url+'</h4><br>'+feature.properties.title
,popupOptions);
}
}).addTo(map);
}
});