WPF Markers

Mar 12, 2009 at 3:09 PM
Sorry folkes, need a bit of clarity here...
Are WPF markers currently working in version gmap4dotnet-32093.
I've tried the MainMap.AddMarker(marker) code, but the markers are not being created (looks as though the local Canvas X and Y is not being set)

Is this right, or am I missing something (which is usually the case!)

Here's my code:

 

PointLatLng? start = GMaps.Instance.GetLatLngFromGeocoder(location);

 

 

if (start != null)

 

{

 

GMapMarkerCircle c = new GMapMarkerCircle(MainMap);

 

c.Position = start.Value;

c.Label.Content =

String.Format("Marker {0}",MainMap.Objects.Count);

 

MainMap.AddMarker(c);

}



regards
John

p.s. nice work radioman.
Mar 13, 2009 at 10:32 AM
Got it working, removed the itemsource = Objects, and then added the canvas

 

 

 

void GMap_Loaded(object sender, RoutedEventArgs e)

 

{

Core.StartSystem();

 

this.Items.Add(Canvas);

 

 

//this.ItemsSource = Objects;

 

 

 

 

 

//worker.RunWorkerAsync();

 

 

 

 

}

 

 

 

Also added...

 

  •  ObservableCollection of GMarkMarker to keep track of what markers I've got.
  • IsCurrentMarker boolean to GMapMarker
  • MouseDown event in GMapMarker to set it as CurrentMarker

Would really like to see some AddPolygon() / AddLayer() functionality... I can work on it here and post it later.

Coordinator
Mar 13, 2009 at 11:36 AM
Edited Mar 15, 2009 at 2:21 PM
wpf version in latest trunk is in testing, use previous sets to get working stuff ;} Any ideas about how to add shapes using ItemsSource are very welcome!