Viewing 1 replies (of 1 total)
  • Thread Starter benbois

    (@benbois)

    I found a way but not 100% happy with it because the map is reloading each time I change the KML with a flashing gray screen.
    Here you are the JS code:

    <script>
    function mapRedraw(idmap,url) {
    	var f = new FlexibleMap();
    	f.dblclickZoom=false;
    	f.scrollwheel=true;
    	f.mapTypeControl=false;
    	f.showKML(idmap, "<?php echo $base; ?>" + url + "?v=2");
    }
    
    jQuery(window).ready(function() {
       jQuery(".map-link").click( function(e){
    	e.preventDefault();
    	var kml_link = jQuery(this).data("url");
    	var kml_map = jQuery(this).data("map");
    	var kml_type = jQuery(this).data("type");
            if(kml_type == undefined) kml_type="kml";
    	var kml_lang = "_" + jQuery(this).data("lang");
    	if(kml_lang == '_undefined') kml_lang="<?php echo $locale; ?>";
    
    	var link = kml_link + kml_lang + "." + kml_type;
    	 mapRedraw(kml_map,link);
    
       });
    });
    </script>

    Any idea to do the same without reloading the map and avoiding each time the flashing gray screen on the map area ?

    Cheers,

    Ben

Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic loading KML files on the same FlexMap without to refresh the page’ is closed to new replies.