Leaflet / Leaflet.label

Leaflet.label is plugin for adding labels to markers & shapes on leaflet powered maps.
MIT License
465 stars 225 forks source link

Static labels on Polylines, Polygons and Paths #123

Closed dr-itz closed 8 years ago

dr-itz commented 9 years ago

This adds support for static labels on Polylines, Polygons and (using a user supplied LatLng) Paths. It's based on top of Pull #122.

Commit (dr-itz@6042d1e) is not really related to static labels. But messing with the offsets actually uncovered the bug that lead to dr-itz@192aaf4 and I think it's an improvement and makes styling the labels easier.

The last commit (dr-itz@f31caeb) is an additional little feature: passing click events to the source. A user is likely to expect a click on the label to have the same effect as a click on the polyline. While this is just a few additional lines of code w/o this commit, I think this expectation is common enough to justify the additional option.

yohanboniface commented 9 years ago

I would rather keep the leaflet 1.0 changes and the path static label changes in two separate PRs, make it easier to read. :) Also, can you please remove the dist files from the commit?

dr-itz commented 9 years ago

I agree the 1.0 changes together with this is not optimal, but the fixes from the leaflet-1.0-fixes branch are required for this stuff to work at all. The full diff is a bit large, but the individual commits should be small enough.

I'll rebase this once I rebase the leaflet-1.0-fixes and fold the last patch I did today (dr-itz@c410baa) into dr-itz@192aaf4 where I broke stuff. And I'll rebase again once the 1.0 fixes are merged :)

dr-itz commented 9 years ago

Everything rebased and now tested for my use case as well.

yohanboniface commented 9 years ago

Sorry, can you rebase again on leaflet-master branch, also removing Leaflet as done there, so we have something easier to read and merge?

Thanks!

dr-itz commented 9 years ago

Please see https://github.com/Leaflet/Leaflet.label/pull/122#issuecomment-136399158 I'll rebase once that's fixed....

dr-itz commented 8 years ago

See #140. Rebased onto new leaflet-master with target branch changed as well. (@GitHub: Why can't I change the target branch of a pull request?)