Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions src/layer/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,20 @@ lvector.Layer = L.Class.extend({
_fireClickEvent: function (feature, event) {
this.options.clickEvent(feature, event)
},

//
// Optional mouseover event
//
_fireMouseoverEvent: function (feature, event) {
this.options.mouseoverEvent(feature, event)
},

//
// Optional mouseout event
//
_fireMouseoutEvent: function (feature, event) {
this.options.mouseoutEvent(feature, event)
},

//
// Get the appropriate Google Maps vector options for this feature
Expand Down Expand Up @@ -722,6 +736,47 @@ lvector.Layer = L.Class.extend({
}(feature));

}

if (this.options.mouseoverEvent) {
var me = this;
var feature = data.features[i];

(function(feature){
if (feature.vector) {
feature.vector.on("mouseover", function(event) {
me._fireMouseoverEvent(feature, event);
});
} else if (feature.vectors) {
for (var i3 = 0, len = feature.vectors.length; i3 < len; i3++) {
feature.vectors[i3].on("mouseover", function(event) {
me._fireMouseoverEvent(feature, event);
});
}
}
}(feature));

}

if (this.options.mouseoutEvent) {

var me = this;
var feature = data.features[i];

(function(feature){
if (feature.vector) {
feature.vector.on("mouseout", function(event) {
me._fireMouseoutEvent(feature, event);
});
} else if (feature.vectors) {
for (var i3 = 0, len = feature.vectors.length; i3 < len; i3++) {
feature.vectors[i3].on("mouseout", function(event) {
me._fireMouseoutEvent(feature, event);
});
}
}
}(feature));

}

}

Expand Down