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

How do I add custom leaflet.js overlays? #576

Open
Kinboise opened this issue Apr 8, 2023 · 0 comments
Open

How do I add custom leaflet.js overlays? #576

Kinboise opened this issue Apr 8, 2023 · 0 comments

Comments

@Kinboise
Copy link

Kinboise commented Apr 8, 2023

I have a manually drawn .svg file (not from Dynmap) with a lot of markers (road names, etc.), and I want to use it as a leaflet.js overlay with these code:

var svgElement = document.getElementById('svg');
var latLngBounds = L.latLngBounds([[-7200,-2560], [2336,2560]]);
map.fitBounds(latLngBounds);

var svgOverlay = L.svgOverlay(svgElement, latLngBounds, {
opacity: 1.0,
interactive: false
}).addTo(map);

Where should I put these code to make it work?
Thanks!

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