The KML file must be accessible from a publicly accessible address. This is
explained in documentation, but I made the same error
before understanding it ;-)
It seems that the KML file is loaded and preprocessed through some server on
google side.

Regards, Davide




2010/6/23 ebakunin <[email protected]>

> Hello,
>
> I'm trying to learn how to use the KmlLayer class from my localhost. I
> tried using the code in the tutorials and everything worked fine:
>
> var georssLayer = new google.maps.KmlLayer('http://api.flickr.com/
> services/feeds/geo/?g=322...@n20&lang=en-us&format=feed-georss');
> georssLayer.setMap(myMap);
>
> var ctaLayer = new google.maps.KmlLayer('http://gmaps-
> samples.googlecode.com/svn/trunk/ggeoxml/cta.kml');
> ctaLayer.setMap(myMap);
>
> However, when I copied the content of those feeds into test files on
> my localhost nothing works:
>
> var georssLayer = new google.maps.KmlLayer('http://localhost/
> testing.xml');
> var ctaLayer = new google.maps.KmlLayer('http://localhost/
> testing.kml');
>
> Can anyone explain what's going on? Thanks for the help.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to