¿Es posible agregar un cursor para las ventanas emergentes de pines sin necesidad de crear este código desde cero? En este momento puedo hacer clic en los marcadores y aparece la ventana emergente.
¿Hay alguna manera de agregar un mouseenter para las ventanas emergentes a mi código existente?
if($('#map').length) { const geoLocation = $('.graphic_map').data('json'); const mapCenterPos = $('.graphic_map').data('center-pos'); const mapZoom = $('.graphic_map').data('zoom'); mapboxgl.accessToken = 'token goes here'; var map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/light-v10', center: mapCenterPos, zoom: mapZoom ? mapZoom : 14 }); map.addControl(new mapboxgl.NavigationControl()); geoLocation.features.forEach(function (marker) { var el = document.createElement('div'); el.className = `marker ${marker.status}`; new mapboxgl.Marker(el) .setLngLat(marker.geometry.coordinates) .setPopup(new mapboxgl.Popup({ offset: [130, -15] }).setHTML( ` <div class="tooltip"> <div class="tooltip__thumbnail" style="background-image:url('${marker.properties.image}')"></div> <div class="tooltip__text"> <p>${marker.properties.title.replace('~',"'")}</p> <div>${marker.properties.description}</div> <a class="tooltip__view" href="${marker.properties.link}">View</a> </div> </div> ` ) ) .addTo(map); const legendCheckbox = $('.graphic_map__legends').find(`[name=${marker.status}]`); $(legendCheckbox).parent().click(function() { $('.graphic_map__legend').removeClass('active'); $(this).addClass('active'); $('.graphic_map__legend input').prop('checked', false); $(this).children('input').prop('checked', true); if(marker.status == 'all') { $('.graphic_map__map .marker').show(); } else { $('.graphic_map__map .marker:not(.all)').hide(); $(`.graphic_map__map .marker.${marker.status}`).show(); } }); }); }