Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'lng' of undefined, while using example from documentation. #6

Open
kjrhody opened this issue May 15, 2020 · 1 comment

Comments

@kjrhody
Copy link

kjrhody commented May 15, 2020

I am using the following, from the example, and get an error.

        var pointList = [new L.LatLng(20.00, 140.0), L.LatLng(50.00, -120.0), L.LatLng(70.50, 170.0)];

        //Create and display a wrapping polygon.
        new lw.Polygon(pointList, {
            color: 'red',
            weight: 3,
            opacity: 0.5,
            smoothFactor: 1,
            noWrap:true
        }).addTo(map);

error:

Uncaught TypeError: Cannot read property 'lng' of undefined
    at isCrossMeridian (leaflet.antimeridian-src.js:40)
    at isBreakRing (leaflet.antimeridian-src.js:61)
    at i._createRings (leaflet.antimeridian-src.js:180)
    at i._projectLatlngs (leaflet.antimeridian-src.js:160)
    at i._projectLatlngs (leaflet.antimeridian-src.js:163)
    at i._project (leaflet.js:5)
    at i._reset (leaflet.js:5)
    at i.onAdd (leaflet.js:5)
    at i._layerAdd (leaflet.js:5)
    at i.whenReady (leaflet.js:5)
isCrossMeridian @ leaflet.antimeridian-src.js:40
isBreakRing @ leaflet.antimeridian-src.js:61
_createRings @ leaflet.antimeridian-src.js:180
_projectLatlngs @ leaflet.antimeridian-src.js:160
_projectLatlngs @ leaflet.antimeridian-src.js:163
_project @ leaflet.js:5
_reset @ leaflet.js:5
onAdd @ leaflet.js:5
_layerAdd @ leaflet.js:5
whenReady @ leaflet.js:5
addLayer @ leaflet.js:5
addTo @ leaflet.js:5
@kjrhody
Copy link
Author

kjrhody commented May 15, 2020

I should note I am using Meteor and running the following code to import the JS file:

import * as lw from '../../../client/js/leaflet.antimeridian-src.js';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant