You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's also good to use let or const instead of var since the latter has global scope.
Thanks for writing this as I too struck the problem of the geojson .js project not having @types. I think the better path would have been to insist https://github.com/caseycesari/GeoJSON.js rename their project and create a .dt. You seem to know them and perhaps you could have this conversation? :)
The text was updated successfully, but these errors were encountered:
Thank you for this suggestion! I would find sometime to solve this.
Casey the original author have not been active in that repo for quote some years. I don't know if she would like to spend time to work with those orgs to change its name.
Hi, I had the same problem.
I tried to make a FeatureGroup with multiple LineString.
I had this error : Cannot read properties of undefined (reading 'getFeature')
I've just add this context inside the foreach loop because it was not bound to the original object : //Line 58 of geojson.ts objects.forEach(function(item) { geojson.features.push( this.getFeature({ item: item, params: settings, propFunc: propFunc }) ); }, this);
It works fine now : { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [ -34.7, 10.5 ], [ -36.1, 11 ] ] }, "properties": { "type": "LineString" } }, ...
This code fails:
this
inside functions is bound to the function.It needs to rewritten with arrow function so that
this
is bound to the original object:It's also good to use
let
orconst
instead ofvar
since the latter has global scope.Thanks for writing this as I too struck the problem of the
geojson
.js project not having@types
. I think the better path would have been to insist https://github.com/caseycesari/GeoJSON.js rename their project and create a.dt
. You seem to know them and perhaps you could have this conversation? :)The text was updated successfully, but these errors were encountered: