Layer mouseover
HTML
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css">
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet-src.js"></script>
<div id="map" ></div>
CSS
#map {
height: 400px;
}
JavaScript
// geojson created with http://geojson.io/
var geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"color": "#006600"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
2.4609375,
51.055207338584964
],
[
1.2744140625,
50.02185841773444
],
[
4.68017578125,
49.66762782262192
],
[
2.4609375,
51.055207338584964
]
]
]
}
},
{
"type": "Feature",
"properties": {
"color": "#660000"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-1.6259765625,
49.63917719651036
],
[
1.60400390625,
49.52520834197442
],
[
1.318359375,
47.91634204016118
],
[
-1.16455078125,
47.66538735632654
],
[
-0.8349609375,
48.777912755501845
],
[
-1.6259765625,
49.63917719651036
]
]
]
}
},
{
"type": "Feature",
"properties": { "color": "#000066"},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
3.3837890625,
48.31242790407178
],
[
3.3837890625,
49.32512199104001
],
[
7.55859375,
49.32512199104001
],
[
7.55859375,
48.31242790407178
],
[
3.3837890625,
...