Skip to content

The "click" event cannot be generated on layers with point geometry. #294

@f4gm

Description

@f4gm

Hi everyone. I'm trying to capture the "click" event of an L.VectorGrid.Protobuf instance as follows:

layer.on("click", handler);

The event works for layers with "Polygon" and "LineString" geometry; however, for "Point" geometry layers, the following error appears in the console:

Uncaught TypeError: Cannot read properties of undefined (reading 'lat')
    at Object.project (leaflet.js?v=49550133:1117:95)
    at Object.latLngToPoint (leaflet.js?v=49550133:1019:48)
    at NewClass.project (leaflet.js?v=49550133:2646:35)
    at NewClass.latLngToLayerPoint (leaflet.js?v=49550133:2665:37)
    at NewClass.latLngToContainerPoint (leaflet.js?v=49550133:2715:55)
    at NewClass._fireDOMEvent (leaflet.js?v=49550133:2954:51)
    at NewClass._handleDOMEvent (leaflet.js?v=49550133:2923:16)
    at HTMLDivElement.handler (leaflet.js?v=49550133:1733:21)

My map's initialization has no parameters other than zoom and center. The layer has the interactive parameter set to true.

Metadata

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