Select to view content in your preferred language

KML layer not able to parse KML return data

1521
10
11-30-2010 01:24 AM
BjørnarSundsbø
Deactivated User
I'm trying to use the KmlLayer against http://wms.met.no/googleearth/metno.kml but get the following exception.

Unhandeled exception System.Xml.XmlException: Invalid character in the given encoding. Line 48, position 16.


I'm using version 2.1 RC of the API. The Toolkit.DataSources source available on codeplex does not include this class, so I'm not able to debug it.

Anyone who is able to make this service work, or provide any information on a fix?
0 Kudos
10 Replies
BjørnarSundsbø
Deactivated User
Bjonar, have you been able to work with kmz files? Most of the kml data that I hope to use in our map is compressed as kmz.


I'm sorry Tony, but I have not. So far we have only been working with KML for prototyping on what we might want to do, and I have only looked at the url from the initial post. But based on the speed on the data from that URL, I would very much like to have the data compressed :o)

If I do run across it, I will try to let you know. And hopefully vice-verca?

But by just guessing, I think KMZ is compressed using GZip. Without never having tried it, you could have a look at the GZipStream class. Update the source code for KmlLayer in the codeplex project to use the GXZipStream if the IsCompressed property of your updated class is true? Or use SharpZipLib

Bjørnar Sundsbø
0 Kudos