nuclearsecrecy / Leaflet.greatCircle

A plugin wrapper class for the Leaflet.js Polygon object that draws it as a great circle (i.e., showing true spherical paths) rather than a perfect circle that gets highly distorted at the poles or when rendered with a very large radii on the web Mercator projection.
MIT License
30 stars 4 forks source link

TypeError: Cannot read properties of undefined (reading 'lng') #2

Open nakigoe opened 2 years ago

nakigoe commented 2 years ago

I receive an error message TypeError: Cannot read properties of undefined (reading 'lng')

for the following code (works OK without the plugin, but the circles ARE distorted)

pointToLayer : function(geoJsonPoint, latlng) {
        return new L.greatCircle(latlng, {
        radius: (Math.exp(geoJsonPoint.properties.mag/1.01-0.13))*4500 });
    }
nuclearsecrecy commented 1 year ago

I really would need to know exactly what is being passed to it to figure out what the issue is. (In some way, all it is indicating is that it isn't understanding the longitude of something, but it's impossible for me to know what is causing it from your code snippet.) Sorry.