0

In this page I have embedded a Google Map using Javascript and loading data from a static KML file loaded on my domain. I want to improve my map loading data from a dynamic KML file stored on google servers (Network link), but this cannot be done directly because of cross-domain restriction. I tried using a php proxy but my hosting service doesn't allow this. (don't ask to me why, I get ERROR 406 response and the customer service said that this kind of request are blocked by their filters!)

So, how can I do cross domain without a proxy?

This is the link that give be the kml file: http://maps.google.com/maps/ms?authuser=0&vps=2&hl=en&ie=UTF8&lr=lang_en|lang_fr|lang_it&oe=UTF8&msa=0&msid=201512616711333791415.0004c56e9ca3fb71ba551&output=kml

Thank you!

Alain1405
  • 2,259
  • 2
  • 21
  • 40

2 Answers2

0

You can use JSONP to overcome the cross domain problem. Look at these links:

http://www.jquery4u.com/json/jsonp-examples/

http://www.ibm.com/developerworks/library/wa-aj-jsonp1/

0

If your kml is being displayed by KmlLayer in the Google Maps API v3 (or GGeoXml in v2, or Google Maps), as long as it is publicly available it will work, there are no cross-domain issues. Maybe you are parsing it yourself, if so, that isn't stated in your question.

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • I am parsing the KML with [GeoXML v3](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CGgQFjAA&url=http%3A%2F%2Fcode.google.com%2Fp%2Fgeoxml-v3%2F&ei=jrwOUPPtNquR0QWf4IDoBQ&usg=AFQjCNFttDkO9z8ln935Ose4zoBDv0lq7A). I need GeoXML for the sidebar. [Here](http://www.tenutalasantissima.com/it/siena-e-la-toscana/) is my map. I'am trying to resolve how suggested from #Muhammad Qasim but I'm noe very confident with JQuery! – Alain1405 Jul 24 '12 at 15:18