I want to display an OSM map on a control, so I've downloaded OsmShap daily build. If I drag and drop a new MapControl to a WinForm, I'll get the following message:
System.NullReferenceException: Object reference not set to an instance of an object
at OsmSharp.WinForms.UI.MapControl.OnPaint(PaintEventArgs e) in D:\OsmSharp\OsmSharp.UI\OsmSharp.WinForms.UI\MapControl.cs:205
at
The error appears because there is no map at design time, so a check for a valid map is needed. I've downloaded the source and created a workaround:
I want to display an OSM map on a control, so I've downloaded OsmShap daily build. If I drag and drop a new MapControl to a WinForm, I'll get the following message:
The error appears because there is no map at design time, so a check for a valid map is needed. I've downloaded the source and created a workaround: