Overlay method is missing, WPF Visual 2010 C#

Topics: Windows Forms
Feb 1, 2012 at 1:26 PM

Hello,

i'm trying to add som overlay to created map by me. Map works fine - properties like MapProvider, Zoom, Position, etc I can handle without any problems. When I want add overlay

mainOverlay = new GMapOverlay(MainMap, "top");

I got following errors:

Error 11 The best overloaded method match for 'GMap.NET.WindowsForms.GMapOverlay.GMapOverlay(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' has some invalid arguments C:\MainWindow.xaml.cs 125 27 AppGUI

Error 12 Argument 1: cannot convert from 'GMap.NET.WindowsPresentation.GMapControl' to 'System.Runtime.Serialization.SerializationInfo' C:\MainWindow.xaml.cs 125 43 AppGUI

Error 13 Argument 2: cannot convert from 'string' to 'System.Runtime.Serialization.StreamingContext' C:\MainWindow.xaml.cs 125 52 AppGUI

Additionaly I can't call MainMap.Overlay - it doesn't show up. So I can't add my map to my my Overlay which I declare earlier without any troubles 

GMapOverlay mainOverlay;

In using part I load

using GMap.NET;
using GMap.NET.WindowsForms;
using GMap.NET.MapProviders;
using GMap.NET.WindowsForms.Markers;
using GMap.NET.WindowsForms.ToolTips;

Do you have any hints, what can be wrong?

Coordinator
Feb 1, 2012 at 1:31 PM

in a recent version you don't need to specify MainMap in parameters

Feb 2, 2012 at 8:56 AM
Edited Feb 2, 2012 at 8:56 AM

Hello,

thanks - constructor run now without any problems.

But still I have some trouble, because I can't add my overlay to my map as in example

 

MainMap.Overlays.Add(routes);
MainMap.Overlays.Add(polygons);
MainMap.Overlays.Add(objects);
MainMap.Overlays.Add(top);

 

It seems that I don't have acces to Overlays - maybe screen will clearify my situation 

Coordinator
Feb 2, 2012 at 10:40 AM

wpf version never has any overlays, only map.Markers by default

Feb 8, 2012 at 12:32 PM

Thank you :)