Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How to put markers from layer WTGS (which reads geojson from php file returned from postgis database) to L.MarkerClusterGroup?

WTGS = new L.geoJson(null, {
            pointToLayer: function (feature, latlng) {
              return L.marker(latlng, {
                icon: icon1,
                title: feature.properties.Locatie
              });
            },
            onEachFeature: function (feature, layer) {
              if (feature.properties) {
                var content = '<table border="1" style="border-collapse:collapse;" cellpadding="2">' +
                    '<tr>' + '<th>ID</th>' + '<td>' + feature.properties.ID + '</td>' + '</tr>' +
                    '<tr>' + '<th>Gemeente</th>' + '<td>' + feature.properties.Gemeente + '</td>' + '</tr>' +
                    '<tr>' + '<th>Fab</th>' + '<td>' + feature.properties.Fab + '</td>' + '</tr>' +
                    '<tr>' + '<th>Start</th>' + '<td>' + feature.properties.Start + '</td>' + '</tr>' +
                    '<table>';
                layer.bindPopup(content);
              }
            }
        });
        $.getJSON("php/wtg.php", function (data) {
            WTGS.addData(data);
        }).complete(function () {
            map.fitBounds(WTGS.getBounds());
        });
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.