Skip to content

Commit

Permalink
Removing files and updating readme to point to master repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtoye committed Jan 22, 2013
1 parent 05da385 commit af19743
Show file tree
Hide file tree
Showing 27 changed files with 2 additions and 9,056 deletions.
23 changes: 0 additions & 23 deletions CHANGELOG.md

This file was deleted.

65 changes: 0 additions & 65 deletions Jakefile.js

This file was deleted.

20 changes: 0 additions & 20 deletions MIT-LICENCE.txt

This file was deleted.

67 changes: 2 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
Leaflet.label
=============
#Leaflet.label

Leaflet.label is plugin for adding labels to markers & shapes on leaflet powered maps.

Check out the [demo](http://leaflet.github.com/Leaflet.label/).

##Usage examples

If you want to just bind a label to marker that will show when the mouse is over it, it's really easy:

````
L.marker([-37.7772, 175.2606]).bindLabel('Look revealing label!').addTo(map);
````

Path overlays works the same:

````
L.polyline([
[-37.7612, 175.2756],
[-37.7702, 175.2796],
[-37.7802, 175.2750],
]).bindLabel('Even polylines can have labels.').addTo(map)
````

If you would prefer the label to be always visible set the ````noHide: true```` option and call ````showLabel()```` once added to the map:

````
L.marker([-37.785, 175.263])
.bindLabel('A sweet static label!', { noHide: true })
.addTo(map)
.showLabel();
````

*N.B.* if you call `showLabel()` before it is added to the map the label will not show.

##Options

When you call ````bindLabel()```` you can pass in an options object. These options are:

- **noHide**: doesn't attach event handler for showing/hiding the label on mouseover/out.
- **className**: the css class to add to the label element

##Positioning the label for custom icons

The label is positioned relative to the L.Icon's ````iconAnchor```` option. To reposition the label set the ````labelAnchor```` option of your icon. By default ````labelAnchor```` is set so the label will show vertically centered for the default icon (````L.Icon.Default````).

E.g. Vertically center an icon with ````iconAnchor```` set as the center of the icon:

````
var myIcon = L.icon({
iconUrl: 'my-icon.png',
iconSize: [20, 20],
iconAnchor: [10, 10],
labelAnchor: [6, 0] // as I want the label to appear 2px past the icon (10 + 2 - 6)
});
L.marker([-37.7772, 175.2606], {
icon: myIcon
}).bindLabel('Look revealing label!').addTo(map);
````

When positioning the label L.Label includes a 6px horizontal padding. you will need to take this into account when setting ````labelAnchor````.

##Alternative label plugin

My previous label plugin is still available at https://github.com/jacobtoye/Leaflet.iconlabel. This plugin is a little harder to use, however if you want to have both the icon and label bound to the same event this plugin is for you.
This repo has been moved to https://github.com/Leaflet/Leaflet.label. Please update any links or bookmarks you have.
64 changes: 0 additions & 64 deletions build/build.js

This file was deleted.

16 changes: 0 additions & 16 deletions build/deps.js

This file was deleted.

30 changes: 0 additions & 30 deletions build/hint.js

This file was deleted.

47 changes: 0 additions & 47 deletions build/hintrc.js

This file was deleted.

Binary file removed dist/images/death.png
Binary file not shown.
Loading

0 comments on commit af19743

Please sign in to comment.