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

I couldn't see a way to disable marker icons for the start and end points. #102

Closed
kreativejuices opened this issue Oct 13, 2020 · 1 comment

Comments

@kreativejuices
Copy link

Love this plugin, just couldn't see any way to disable the start and end markers. I only wanted the polyline to be shown. So i tried this,

marker_options: {
startIconUrl: '',
endIconUrl: '',
shadowUrl: ''
}

It does the job but wondered if there was a better way to do this?

Thanks! :)

@kreativejuices kreativejuices changed the title I couldn't see a way to disable marker icons for the star and end points. I couldn't see a way to disable marker icons for the start and end points. Oct 13, 2020
@mpetazzoni
Copy link
Owner

That's the way; a slightly cleaner version is to set them to null instead of an empty string. The code just checks for "falsy":

if (options.marker_options.startIcon || options.marker_options.startIconUrl) {

https://github.com/mpetazzoni/leaflet-gpx/blob/main/gpx.js#L537-L554

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

2 participants