Can't fetch external style from KML
See original GitHub issueDescribe the bug Unable to fetch external KML style from <styleUrl>. It may detect a wrong baseUri, can’t fetch style and then display default style.
To Reproduce Steps to reproduce the behavior:
- Read a KML file that contains external style (exemple with
<styleUrl>http://www.gdacs.org/styles/kmlstyle.kml#TC_Line</styleUrl>
) - Try again with a kml viewer like http://kmlviewer.nsspot.net/
- See error
Bug :
Expected behavior Expected style :
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Why does physicalWidth not work in external style for Google ...
The KML file that contains the placemark and the KML file that contains the external style are in the same directory. I know...
Read more >Can't Connect External Stylesheet to HTML - Stack Overflow
In my HTML sheet, I've already linked to the external CSS stylesheet as well. The HTML code is below. <style> <link rel="stylesheet" ...
Read more >KML Reference | Keyhole Markup Language
This section contains an alphabetical reference for all KML elements defined in KML Version 2.2, as well as elements in the Google extension...
Read more >KML layers—ArcGIS Pro | Documentation
KML layer structure ... The elements of a KML file are structured hierarchically, where each part of the hierarchy is called a node....
Read more >Unable to fetch a KML file - Google Groups
that didn't do anything but return the 'Bad or null KML.' error that is built into the fetch KML code given in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for your quick answers, so there is two issues here :
readFeatures()
is synchronous for now, so it can’t load styles from external sources. The solution I see is to first check every external sourceUrl and load them before to execute readFeatures().{crossOrigin: null}
could be a solution.You could use
new KML({crossOrigin: null})
to allow cross origin icons without CORS if you can tolerate imprecise hit detection and tainted canvas.