I was trying to load a KML file from the DesktopEditionSample KmlExtension example in my application, but I get the following exception on the map refresh.
The type initializer for 'xRM=.OxY=' threw an exception.
at xRM=.OxY=.PhY=(String nodeLocalName)
at ThinkGeo.MapSuite.Core.KmlFile.ReadStyles()
at ThinkGeo.MapSuite.Core.KmlFile.Open()
at ThinkGeo.MapSuite.Core.KmlFeatureSource.OpenCore()
at ThinkGeo.MapSuite.Core.FeatureSource.Open()
at ThinkGeo.MapSuite.Core.FeatureLayer.OpenCore()
at ThinkGeo.MapSuite.Core.Layer.Open()
at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.sRM=(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.dRQ=(IEnumerable`1 drawingOverlays, RectangleShape extent)
private void kMLToolStripMenuItem_Click(object sender, EventArgs e)
{
winformsMap1.Overlays.Clear();
//Set the geography unit to decimal degrees, to defines how your map data is stored
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
winformsMap1.CurrentExtent = new RectangleShape(-122.0874, 37.4245, -122.0804, 37.4201);
WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();
worldMapKitDesktopOverlay.Name = "worldMap";
worldMapKitDesktopOverlay.MapType = WorldMapKitMapType.Road;
winformsMap1.Overlays.Add("worldMap", worldMapKitDesktopOverlay);
KmlFeatureLayer layer = new KmlFeatureLayer("C:\\ThinkGEO\\KmlExtensionSample\\App_Data\\KML_Samples.kml");
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoPen(GeoColor.SimpleColors.Black), new GeoSolidBrush(GeoColor.SimpleColors.Yellow));
layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = new LineStyle(new GeoPen(GeoColor.SimpleColors.Blue, 5));
layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(GeoColor.SimpleColors.Green), 10);
LayerOverlay stateOverlay = new LayerOverlay();
stateOverlay.Layers.Add("KmlLayer", layer);
winformsMap1.Overlays.Add("StateOverlay", stateOverlay);
winformsMap1.Refresh();
}
Thanks Jim