Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author webaware

    (@webaware)

    G’day Japhys,

    You’ll need to add a little JavaScript to your page for this. You need to set the centre on the map (and perhaps also zoom it) once the page has loaded. The KML layer might still be loading tiles then too, so you’ll need to set it again after the tiles have loaded. Here’s a snippet that you can add to your page. Give the map an id so that the script can find it, e.g. id=my_kml_map

    <script>
    jQuery(window).on("load", function() {
        if (window.flxmap_my_kml_map) {
            var flxmap = window.flxmap_my_kml_map,
                map = flxmap.getMap(),
                centre = new google.maps.LatLng(-32.918657,151.797894);
    
            flxmap.setCenter(centre);
            map.setZoom(13);
    
            google.maps.event.addListenerOnce(map, "tilesloaded", function() {
                map.setCenter(centre);
                map.setZoom(13);
            });
        }
    });
    </script>

    cheers,
    Ross

    Thread Starter japhys

    (@japhys)

    Thanks a lot for your quick reply!!

    Plugin Author webaware

    (@webaware)

    No worries, is it working for you now?

    cheers,
    Ross

    Thread Starter japhys

    (@japhys)

    Yup got it working ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using kml and center tag together’ is closed to new replies.