[Pkg-javascript-commits] [leaflet-markercluster] 23/479: Add MIT Licence and update the readme
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:04 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit 9161de52cc4c89da18a23a6012d511ba00cc2fd9
Author: danzel <danzel at localhost.geek.nz>
Date: Mon Jul 16 16:33:57 2012 +1200
Add MIT Licence and update the readme
---
MIT-LICENCE.txt | 20 ++++++++++++++++++++
README.md | 31 ++++++++++++++++++++++++++-----
2 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/MIT-LICENCE.txt b/MIT-LICENCE.txt
new file mode 100644
index 0000000..19af068
--- /dev/null
+++ b/MIT-LICENCE.txt
@@ -0,0 +1,20 @@
+Copyright 2012 David Leaver
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
index e3c1781..24724f4 100644
--- a/README.md
+++ b/README.md
@@ -3,20 +3,21 @@ Leaflet.markercluster
Provides Marker Clustering functionality for Leaflet
-##Using the plugin
-See the included example for usage.
+## Using the plugin
+See the included example for usage. Or [check it out online here](http://danzel.github.com/Leaflet.markercluster/example/marker-clustering.html)
Create a new MarkerClusterGroup, add your markers to it, then add it to the map
```javascript
var markers = new L.MarkerClusterGroup();
markers.addLayer(new L.Marker(getRandomLatLng(map)));
+... Add more layers ...
map.addLayer(markers);
```
-For a more complete example see example/marker-clustering.html
+For the complete example see example/marker-clustering.html
-###Customising the Clustered Marker
+### Customising the Clustered Marker
As an option to MarkerClusterGroup you can provide your own function for creating the Icon for the clustered markers.
The default implementation changes color at bounds of 10 and 100, but more advanced uses may require customising this.
@@ -26,4 +27,24 @@ var markers = new L.MarkerClusterGroup({ options: {
return new L.DivIcon({ html: '<b>' + childCount + '</b>' });
}
}});
-```
\ No newline at end of file
+```
+
+### Events
+
+If you register for click, mouseover, etc events on the MarkerClusterGroup you will get callbacks for both individual markers and clusters.
+Set your callback up as follows to handle both cases:
+
+```javascript
+markers.on('click', function (a) {
+ if (a.layer instanceof L.MarkerCluster) {
+ console.log('cluster ' + a.layer.getAllChildMarkers().length);
+ } else {
+ console.log('marker ' + a.layer);
+ }
+});
+```
+
+### License
+
+
+Leaflet.markercluster is free software, and may be redistributed under the MIT-LICENSE.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git
More information about the Pkg-javascript-commits
mailing list