Hi all,
i want to get total length of my feature layer, i use API version 4. 27.
I tried this code:
view.when(function() {
var length = geometryEngine.geodesicLength(wyalmomaragebareabilitaciebi2025, "meters");
console.log("Polyline length (meteres): ", length);
});
but it did not work, i get ERROR: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'B')
I can do it using query, but it slows load time, help please.
Thank you
Input for geodesicLength() is a geometry, not a feature layer: geometryEngine | API Reference | ArcGIS Maps SDK for JavaScript 4.32 | Esri Developer
You should query a feature from your layer, get feature.geometry and pass it to geodesicLength()