Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to add this kml-link from Google Maps to an OpenLayers instance.

The following code is not working:

var layer = new OpenLayers.Layer.GML("KML", "https://maps.google.de/maps/ms?authuser=0& vps=2&hl=de&ie=UTF8&msa=0&output=kml&msid=203149634091768565111.0004cf65c9b03cc8ae76c", 
{
format: OpenLayers.Format.KML,
formatOptions: {
'extractStyles': true
}
});

Thanks alot for any ideas!

share|improve this question
add comment

1 Answer

You should put the kml on the server and link to the file. Like this:

var layer = new OpenLayers.Layer.GML("KML", "kml/lines.kml", {
   format: OpenLayers.Format.KML
})
map.addLayer(layer);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.