我正在使用 drupal 传单模块,并希望在单击时弹出一个窗口,然后在悬停时将鼠标悬停在角落中。目前我的弹出窗口工作但无法添加鼠标悬停。我读过的所有地方都在说您可以使用 geoJson 对象向功能添加鼠标悬停,但看起来我无法通过此模块使用它访问该对象。这是我的 Js 代码。
(function ($) {
Drupal.behaviors.maps = {
attach:function (context, settings) {
// Add legends to each leaflet map instance in Drupal's settings array
$(settings.leaflet).each(function() {
// Get the map object from the current iteration
var map = this.lMap;
// Create a legend class that will later be instantiated and added to the map
var legend = L.Control.extend({
options: {
position: 'bottomleft'
},
onAdd: function (map) {
// create the control container div with classes
var container = L.DomUtil.create('div', 'info legend');
var html = '<h1>Status</h1>';
html += '<ul>';
html += ' <li><span class="color home"></span> Available Home</li>';
html += ' <li><span class="color lot"></span> Available Lot</li>';
html += ' <li><span class="color not-available"></span> Not Available</li>';
html += '</ul>';
container.innerHTML = html;
return container;
}
});
map.scrollWheelZoom.disable();
map.addControl(new legend());
});
}
};
})(jQuery);
我有弹出窗口,我需要为每个功能添加一个悬停,我该怎么做?