I solved the problem with another plugin .
I can use the overpass-turbo request:
var attr_osm = 'Map data © <a href="http://openstreetmap.org/">OpenStreetMap</a> contributors', attr_overpass = 'POI via <a href="http://www.overpass-api.de/">Overpass API</a>'; var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {opacity: 0.7, attribution: [attr_osm, attr_overpass].join(', ')}); var map = new L.Map('map').addLayer(osm).setView(new L.LatLng(43.592041,2.648164),14); var opl = new L.OverPassLayer({ query: "node[amenity=drinking_water]({{bbox}});out;",})", }); map.addLayer(opl);
or with a custom circle on the map
var opl = new L.OverPassLayer({ query: "node[amenity=drinking_water]({{bbox}});out;",})", onSuccess: function(data) { for(i=0;i<data.elements.length;i++) { e = data.elements[i]; var pos = new L.LatLng(e.lat, e.lon); var color = 'green'; L.circle(pos, 5, { color: color, fillColor: '#fa3', fillOpacity: 1, }).addTo(map); } }, }); map.addLayer(opl);
You can even convert the data received from Overpass, from this to GeoJson. You can draw paths and an area directly.
source share