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

Create a wider selection area to select the lines on react-leaflet map #1097

Open
KishorTSi opened this issue Sep 28, 2023 · 0 comments
Open

Comments

@KishorTSi
Copy link

KishorTSi commented Sep 28, 2023

I have posted the this in stackoverflow earlier, but no use.. Still I didn't receive any solution.

Having difficulty in selecting the lines on react-leaflet map, so I have followed the below solutions,

  1. https://gis.stackexchange.com/questions/466747/create-wider-selection-area-to-select-lines-on-map-using-leafletjs

`const canvasRenderer = L.canvas({
tolerance: 5,
});

<Polyline
    pathOptions={{
        renderer: canvasRenderer,
        color: "Black",
        smoothFactor: 1,
        opacity: 1,
        weight: 3,
    }}
    positions={[51.505, -0.09],[51.51, -0.1],[51.51, -0.12],}
    eventHandlers={{
        contextmenu(e) {
            //some function goes here.
        },
    }}
 ></Polyline>`

The renderer was not working and there was no effect on the polylines. That I have posted here, I think the canvasRenderer wont work for react-leaflet

  1. https://gis.stackexchange.com/questions/168465/making-a-leaflet-line-feature-more-grabbable
    How to use the Leaflet Almost Over plugin with react-leaflet.
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