Używam modułu ulotki drupal i chcę mieć wyskakujące okienko po kliknięciu, a następnie przesuwanie kursora myszy, aby wyświetlić się w rogu po najechaniu myszą. Obecnie mam wyskakujące okienko, ale nie mogę dodać pozycji kursora myszy. Wszędzie czytałem mówi, że można dodać mouseover do funkcji z obiektem GeoJson, ale nie wygląda na to, że mam dostęp do tego obiektu za pomocą tego modułu.Tutaj jest mój kod Js.Jak zrobić wyskakujące okienko i unieść się z wtyczką js do wtyczki?
(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);
mam pracę podręczne, muszę dodaj przy aktywowaniu do każdej funkcji, w jaki sposób mogę to zrobić
Problem polega na tym, że nie utworzę ręcznie warstwy geoJson. Z modułem Drupal przekazuję dane do funkcji "leaflet_render_map", więc bez bezpośredniej edycji modułu ulotki, nie mam bezpośredniego dostępu do obiektu geoJson – jakecraige