-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandomCode.js
More file actions
24 lines (21 loc) · 895 Bytes
/
randomCode.js
File metadata and controls
24 lines (21 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var onEachFeature = function(feature, layer) {
// Load the default style.
layer.setStyle(defaultStyle);
// Create a self-invoking function that passes in the layer
// and the properties associated with this particular record.
(function(layer, properties) {
// Create a mouseover event
layer.on("mouseover", function (e) {
// Change the style to the highlighted version
layer.setStyle(highlightStyle);
});
// Create a mouseout event that undoes the mouseover changes
layer.on("mouseout", function (e) {
// Start by reverting the style back
layer.setStyle(defaultStyle);
// And then destroying the popup
});
// Close the "anonymous" wrapper function, and call it while passing
// in the variables necessary to make the events work the way we want.
})(layer, feature.properties);
};