0

I'm using a Geolocation Fields View with Drupal 8 and need to manipulate the Style of the Marker Info Window. there is no class to style the pop-Up-window for the Info Text. The Info Text has a class named gm-style-iw. I would like to do this:

var popupcontent = $('.gm-style-iw');
popupcontent.parent().addClass('gmap-popup');   

But I can't get the right event. I can get the Click on Map Event with this:

   if (typeof Drupal.geolocation !== 'undefined') {
     Drupal.geolocation.googleCallbacks.push({'callback' : function () {
        Drupal.geolocation.maps[0].googleMap.addListener('click', function() {
        console.log('Clicked on the map.');
        });
     }});
    }

But I need to get the Click on Marker Event. I can not figure out the Marker Objekt and the right syntax for the click event.

1 Answer 1

0

Try this:

if (typeof Drupal.geolocation !== 'undefined') {
            Drupal.geolocation.googleCallbacks.push({'callback' : function () {
                Drupal.geolocation.maps[0].googleMap.addListener('tilesloaded', function() {
                    $('.geolocation-common-map').on('click', function() {
                        console.log('Clicked on the map.');
                    });
                });
            }});
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.