Kml layers doesn't update when reloading the page

后端 未结 2 1323
心在旅途
心在旅途 2021-01-17 22:43

[EDIT] it seems the problem comes from google maps which takes some time to update the KML link...I\'m not sure, but in the end, it works...[/EDIT]

I embedded an exi

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-17 23:34

    Google's servers cache the KML content for some period of time. To force the rendered KML to update, add a cache busting parameter to the URL. I usually use a function of the date/time if I need to do it programmatically, or if it is just a one time edit a manual ?a=0 and incrementing that as I make changes works.

    Something like this (if you don't have any other query parameters in the URL):

     var URL = filename+"?dummy="+(new Date()).getTime();
    

提交回复
热议问题