You are here

KML.txt in Openlayers 6.2

Same filename and directory in other branches
  1. 7.2 docs/KML.txt
Current for 2.x

# KML

Many users find it necessary to include KML files on their websites, and often
KML files are located on remote servers; especially dynamic KML. However, the
core of the [XMLHttpRequest](http://en.wikipedia.org/wiki/XMLHttpRequest)
object, the Javascript convenience that allows AJAX to happen, prevents requests
across domains.

This means that a site

    http://www.hello.com/

cannot load KML from

    http://world.com/

Without a special workaround.

# Proxy Host

For this, there is a special setting in every preset called "Proxy Host." It is
in the 'General information' tab, at the bottom of the page. You can use any of
a number of [PHP
proxies](http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=php+proxy) for
this purpose, or you can use the [proxy
module](http://drupal.org/project/proxy), which integrates with Drupal.

File

docs/KML.txt
View source
  1. Current for 2.x
  2. # KML
  3. Many users find it necessary to include KML files on their websites, and often
  4. KML files are located on remote servers; especially dynamic KML. However, the
  5. core of the [XMLHttpRequest](http://en.wikipedia.org/wiki/XMLHttpRequest)
  6. object, the Javascript convenience that allows AJAX to happen, prevents requests
  7. across domains.
  8. This means that a site
  9. http://www.hello.com/
  10. cannot load KML from
  11. http://world.com/
  12. Without a special workaround.
  13. # Proxy Host
  14. For this, there is a special setting in every preset called "Proxy Host." It is
  15. in the 'General information' tab, at the bottom of the page. You can use any of
  16. a number of [PHP
  17. proxies](http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=php+proxy) for
  18. this purpose, or you can use the [proxy
  19. module](http://drupal.org/project/proxy), which integrates with Drupal.