WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Location map hide Info Window on load (3 posts)

  1. smarru
    Member
    Posted 2 years ago #

    I am using events manager to add events and associated locations. In the location map, currently it shows the info window on load. I want to hide the info window on load. So I am using the hook 'em_maps_location_hook' mentioned in the events-manager.js But for some reason the info window doesn't close. Can someone please help me with this?

    jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){
    infowindow.close();
    map.panBy(0,0);

    google.maps.event.addListener(marker, 'click', function() {
    infowindow.open(map,marker);
    });
    });

    Thank you,
    Srilatha

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    try this one and improve accordingly

    http://pastebin.com/9yX6Q5gm

  3. smarru
    Member
    Posted 2 years ago #

    Hi Guys, I used below code to hide the infowindow on load and position the marker at center and it worked. Thank you for supplying the map hook.

    jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){

    setTimeout(function(){ infowindow.close(); var latlng = new google.maps.LatLng(map.center.lat(),map.center.lng()); marker.setPosition(latlng); }, 500);

    });

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic