Describe the bug
If a FeatureLayer is created with FeatureLayerOptions that contains a pointToLayer method when one or more of the items in the layer is of type multilinestring, the _redraw method will throw an error when it tries to construct a LatLng object using an array of arrays.
The problem, here, is that instead of checking types and values, the _redraw method relies on the presence or absence of methods being defined to perform operations and then blindly sends what could be an invalid value to other places.
Reproduction
Something like this:
const options = {
url: <someUrl>,
options.pointToLayer = () => void
};
const layer = esri.featureLayer(options);
...
If a multilinestring happens to be one of the elements returned. It blows up from here:
|
latLng(geojson.geometry.coordinates[1], geojson.geometry.coordinates[0]) |
Logs
No response
System Info
leaflet 1.8.0
esri-leaflet 3.0.8
Additional Information
No response
Describe the bug
If a
FeatureLayeris created withFeatureLayerOptionsthat contains apointToLayermethod when one or more of the items in the layer is of typemultilinestring, the_redrawmethod will throw an error when it tries to construct aLatLngobject using an array of arrays.The problem, here, is that instead of checking types and values, the
_redrawmethod relies on the presence or absence of methods being defined to perform operations and then blindly sends what could be an invalid value to other places.Reproduction
Something like this:
If a
multilinestringhappens to be one of the elements returned. It blows up from here:esri-leaflet/src/Layers/FeatureLayer/FeatureLayer.js
Line 402 in 7ee4b61
Logs
No response
System Info
Additional Information
No response