Sto usando il modulo volantino drupal e voglio avere un popup sul clic, e poi un mouseover per mostrarlo nell'angolo quando si passa il mouse. Attualmente ho il popup che funziona ma non posso aggiungere un mouseover. Ovunque ho letto sta dicendo che puoi aggiungere un mouseover alla funzione con l'oggetto geoJson ma non sembra che abbia accesso a quell'oggetto che lo usa tramite questo modulo.Qui è il mio codice JsCome fare un popup e passare il mouse con il plugin js per gli opuscoli?
(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);
ho il lavoro a comparsa, ho bisogno di aggiungere un on hover per ogni funzione, come posso fare che
Il problema con questo è che non creo il livello geoJson manualmente. Con il modulo Drupal trasmetto i dati a una funzione "leaflet_render_map", quindi senza modificare direttamente il modulo leaflet, non ho accesso diretto all'oggetto geoJson – jakecraige