I have a hard time adding a simple feature layer from my ArcGIS Online account to a Leaflet project. This is my approach:
<script src="https://unpkg.com/esri-leaflet/dist/esri-leaflet.js"></script>
var esri = L.esri.featureLayer({
url: "https://services3.arcgis.com/G1WwgjpwOa4JbyeG/arcgis/rest/services/Datensatz/FeatureServer",
style: function () {
return { color: "#70ca49", weight: 2 };
}
}).addTo(map);
So nothing too complicated here, but it just wont't load the layer. When I inspect the Code in my browser it says:
"Failed to load resource: the server responded with a status of 400 ()".
I uploaded the leaflet project on a webserver if you want to check it: www.wasserwiki.eu/Wasserwiki_App_Mobile