Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'lat') #267

Open
@iamtekson

Description

I have tried to implement the onClick event using this plugin as below,

const vectorGrid = L.vectorGrid
  .slicer(street, {
    rendererFactory: L.svg.tile,
    maxNativeZoom: 19,
    maxZoom: 20,
    interactive: true,
    getFeatureId: function (f) {
      return f.properties.name;
    },
  })
  .on("click", function (e) {
    console.log(e);
  })
  .addTo(map);

When I clicked the layer, it shows the following error,

Uncaught TypeError: Cannot read properties of undefined (reading 'lat')
    at Object.project (Projection.SphericalMercator.js:24)
    at Object.latLngToPoint (CRS.js:28)
    at i.project (Map.js:993)
    at i.latLngToLayerPoint (Map.js:1015)
    at i.latLngToContainerPoint (Map.js:1072)
    at i._fireDOMEvent (Map.js:1434)
    at i._handleDOMEvent (Map.js:1397)
    at HTMLDivElement.c (DomEvent.js:92)

In this error log, I didn't find the error linked to my vector grid file. Please help me how can I solve this issue?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions