Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix KML descriptions that link to relative paths #5352

Merged
merged 2 commits into from
May 23, 2017
Merged

Fix KML descriptions that link to relative paths #5352

merged 2 commits into from
May 23, 2017

Conversation

mramato
Copy link
Contributor

@mramato mramato commented May 23, 2017

If a KML description included a relative path, the browser request would end up using whatever server the application was hosted on as the base path, this is because the KML HTML would be injected into the InfoBox as-is. The end result is that relative images and links inside of KML files would not load properly.

To fix this, we now expand all relative paths into absolute paths that use the KML's source Uri as the bas.

I added a test that fails in master and passes in this branch; but if you want to test this manually, you can unzip gdpPerCapita2008.kmz into it's own subdirectory and load the KML. Click on any item and it will be missing images in master, but they properly show up in this branch (the KMZ itself always worked because it goes through a different code path).

mramato added 2 commits May 23, 2017 15:38
If a KML description included a relative path, the browser request would
end up using whatever server the application was hosted on as the base
path, this is because the KML HTML would be injected into the InfoBox
as-is. The end result is that relative images and links inside of KML
files would not load properly.

To fix this, we now expand all relative paths into absolute paths that
use the KML's source Uri as the bas.
@hpinkos
Copy link
Contributor

hpinkos commented May 23, 2017

👍 thanks @mramato!

@hpinkos hpinkos merged commit 0abb246 into master May 23, 2017
@hpinkos hpinkos deleted the kml-paths branch May 23, 2017 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants