Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Static labels on Polylines, Polygons and Paths #140

Open
wants to merge 5 commits into
base: leaflet-master
Choose a base branch
from

Conversation

dr-itz
Copy link

@dr-itz dr-itz commented Nov 16, 2015

Same as #123, but with the target branch changed to the new rebased leaflet-master.

dr-itz and others added 5 commits November 16, 2015 15:53
Support for static labels on a Path/Polyline/Polygon. The user can supply
a LatLng in the showLabel() method. If none is specified, the getCenter()
methos is used if available.
The Label option should reflect the actual value. This is preparation for
the next commit.
Setting the option offset:[0, 0] and clickable:true causes the label <div>
be just under the mouse, firing a 'mouseout' on the Path, making the Label
disappear and re-appear again resulting in flickering or no label at all.
This make 'clickable' and 'noHide' mutually exclusive. Also, in
noHide:false mode, clicking the label is not possible anyway as it
moves with the mouse.
The correct offsets depend on CSS. Make [0, 0] the default and use CSS
'margin-top' and 'margin-left' to handle it instead. This way, changing
the offset option is not necessary when changing CSS like makeing the
border smaller. Tested in FF, Chrome, Safari and even IE10.
If these options are set: { clickable: true, passClickToSource: true },
mouse click event will be passed to the source object.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants