2

i'm newbie in GIS. i'm trying to make webgis using leaflet. i already make layer with icon in leaflet.

/*layer*/
    var layer = new L.GeoJSON.AJAX("GIS/layer/request_layer.php", {
        middleware:function(data){ 
        return L.geoJson(data, {
            onEachFeature: function(feature, layer){
                layer.bindPopup("<center>" + feature.properties.id + "<center>"),
                layer.setIcon(icon);
            }
        }).addTo(map);
        }
    });

/*icon layer*/
    var icon = L.icon({
            iconUrl : 'GIS/leaflet/images/icon.png',
            iconSize : [15,15],
            popupAnchor : [0, -28]
        });

how to add buffer in this layer ?

2

Another easy option is Turf JS. It's easy to use with Leaflet. http://turfjs.org/docs/#buffer

1

Use the Buffer plugin for leaflet. If you are new to GIS and Leaflet then I recomend you spend some time reviewing all the plugins that are available to you as there are a lot and you'll find many of the invaluable for your purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.