WordPress.org

Ready to get started?Download WordPress

Forums

Advanced AJAX Page Loader
[resolved] Google Maps not visible (7 posts)

  1. koenjansen1990
    Member
    Posted 2 years ago #

    Hi there, When I produce an event with the location in google maps, he is not shown. However, when I refresh the page, it is visible. here you can see the problem when you click on 'agenda'.

    Thanks in advance

    Koen Jansen

    http://wordpress.org/extend/plugins/advanced-ajax-page-loader/

  2. Dean Williams
    Member
    Plugin Author

    Posted 2 years ago #

    This is because when you load a page with AJAX - you need to recall any javascript used to bind things like Google Maps to a page because the new HTML in the page is not re-parsed automatically by JavaScript.

    Just put the google maps code into the "reload code" section of the admin panel - and all should work correctly.

  3. vshall21
    Member
    Posted 1 year ago #

    HI,
    i use this function in reload code but its not working.
    i have placed
    window.onload=initialize; in my page.php code but nothing worked for me map display only when i page refresh or place any button and put onclick event on it but window.onload function not working.

    function initialize() {

    var myLatlng = new google.maps.LatLng(53.514163,-0.03512);
    var mapOptions = {
    center: myLatlng,
    zoom: 16,
    mapTypeId: google.maps.MapTypeId.ROADMAP
    };

    var contentString = '<div><b>La Brouse</b>
    '+
    '60 Threadneedle Street
    '+
    'London
    ';

    var infowindow = new google.maps.InfoWindow({
    content: contentString
    });

    var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
    var marker = new google.maps.Marker({
    position: myLatlng,
    map: map,
    icon: '/wp-content/themes/Labourse_pdf/images/map.png',
    title: ''
    });

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

  4. dbrunsden
    Member
    Posted 1 year ago #

    Hi how did you fix this?

  5. vshall21
    Member
    Posted 1 year ago #

    I haven't fixed it yet,i am waiting for the reply.

    Thanks.

  6. vshall21
    Member
    Posted 1 year ago #

    Hi,
    i resolved it via iframe if anyone is facing the same problem put your gmap custom funtion in iframe and then call into page

    it will work for you

    Thanks.

  7. Dean Williams
    Member
    Plugin Author

    Posted 1 year ago #

    sneaky cheat but glad you got a solution working :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic