【发布时间】:2013-07-23 16:02:02
【问题描述】:
我正在使用 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);
我的弹出窗口正常工作,我需要为每个功能添加悬停,我该怎么做?
【问题讨论】:
标签: javascript drupal leaflet