Marker Groups

Mar 11, 2009 at 11:25 AM
Please add a GROUP property to the marker and an optional parameter on the ZoomAndCentreAllMarkers ( optional Group )

I plot all clients on the map using different markers for the type of clients, but i then use a different marker type for the vans that i plot in realtime from GPS links.
What i want to do is still see all the client markers on the map, but zoom to only the Vans.   If you add a GROUP property to the marker class then i can
simply set the van markers as group VANS,  and then on the ZoomAndCentre method, just zoom to the VANS group. (optional GROUP parameter )

Thanks,

Coordinator
Mar 11, 2009 at 2:23 PM
Edited Mar 15, 2009 at 3:21 PM
Ok

Mar 11, 2009 at 2:24 PM
oh in, WinForms  pls   :-)

Mar 11, 2009 at 2:29 PM
....and please dont forget to implement the toolstrip class :-)

greets

ronny
Mar 12, 2009 at 6:31 PM
My marker needs are slightly more complex with several overlapping groupings and some dynamic group selection.  My plan was to work up a ZoomAndCenterMarkers(MarkerList markers) method and leave the list membership selection up to my client side code.  I suppose I could update each marker's group property to be 'selected' for the current group selection criteria and then do the ZACM('selected')... 

Thanks for all the great work!
Mar 17, 2009 at 7:07 PM
hi radioman,
any news on the ToolTips working in WinForms, when is the next release expected ? thanks
Coordinator
Mar 17, 2009 at 9:13 PM
depends of unknow, hard to tell ;} in a few weeks maybe
Mar 18, 2009 at 12:13 PM
Hi Radioman, I've now got marker / overlay groups working plus the ability to link overlays to markers so they move when the parent marker moves. I am aware though that this is taking my version away from yours, would you be interested in a copy of my version?...if so, what's the best way to get it to you. I've got a set of requirement here that I'm coding for that will mean I have to implement multiple markers, radius overlays (now working) and polygon overlays (starting soon). If this is where you also want to go we can make sure there is no duplication of effort.

Cheers
Moose

p.s. Once again mate...excellent piece of work!
Mar 18, 2009 at 12:33 PM
Is this in the WinForms version ? and if not, would anyone be able to convert to WinForms too ? thanks
Mar 18, 2009 at 1:01 PM
Sorry Paul, I'm on the WPF version, although changing to winforms should be a doddle...it's all c#, it's just the presentation that different.
Moose
Coordinator
Mar 18, 2009 at 4:51 PM
it would be great if your marker system will use ItemSource patern, the same as in windows forms, i just currently don't know how to add custom shapes....
Mar 18, 2009 at 5:11 PM
If you change it so that your not actually adding shapes, but working with FrameworkElements (which COULD be shapes), thats what I've done. I can take a look at the winforms implimentation to see how your doing it there.
Mar 18, 2009 at 5:32 PM
Having looked at the way the Markers are rendering in the winforms solutions, I don't think you can use the itemsource pattern. (I may be completely wrong though).

If you just want to have a collection of markers that adds the markers automattically when you add one to the collection, you can handle the ObservableCollections "CollectionChanged" event. You can then query the Action on the System.Collections.Specialized.NotifyCollectionChangedEventArgs . The trouble with that though is that you don't then have a good way of overloading it. In my current wpf version I've got 2 versions of AddMarker, one just adds it, the other add it and specifies the Group. It would be a pain if the only way to add a marker was to alter the collection directly.

 

public void AddMarker(String group, MapObject item)

 

{

 

GMapMarker marker = item as GMapMarker;

 

 

if (marker == null) return;

 

marker.Group = group;

MapMarkers.Add(marker);

 

foreach (KeyValuePair<UIElement, Point> el in marker.Objects)

 

{

Canvas.Children.Add(el.Key);

}

marker.ZIndex = MapMarkers.Count - 1;

marker.UpdateLocalPosition(

this);

 

}

 

public void RemoveMarker(MapObject item)

 

{

 

GMapMarker marker = item as GMapMarker;

 

 

if (marker == null) return;

 

 

if (MapMarkers.Contains(marker))

 

{

MapMarkers.Remove(marker);

 

foreach (KeyValuePair<UIElement, Point> el in marker.Objects)

 

{

Canvas.Children.Remove(el.Key);

}

}

}

Coordinator
Mar 18, 2009 at 5:58 PM
..yes i know, but using ItemsControl would be great...
Mar 18, 2009 at 9:15 PM
Any updates on clicking markers in WinForms?
Mar 23, 2009 at 11:50 AM
RadioMan, just had a "brain fart", you could change your Canvas that holds markers etc to a ListBox, then change the ItemsPanelTemplate to be a canvas, you could then set the itemssource of the listbox...that would lay the items out in your canvas...here's a bit of markup to show what I mean...

cheers
Moose
----------------------------------------------------

<UserControl x:Class="ucTest"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Height="300" Width="300"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008">

<UserControl.Resources>

<ResourceDictionary>

<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="ResourceDictionary.xaml"/>

</ResourceDictionary.MergedDictionaries>

<XmlDataProvider x:Key="UserData" XPath="userData" d:IsDataSource="True" Source="userData.xml" />

</ResourceDictionary>

</UserControl.Resources>

<Grid>

<ListBox ItemsSource="{Binding Mode=Default, Source={StaticResource UserData}, XPath=/userData/cloudItems/item}">

<ListBox.ItemsPanel>

<ItemsPanelTemplate>

<Canvas x:Name="listBoxCanvas" />

</ItemsPanelTemplate>

</ListBox.ItemsPanel>

<ListBox.ItemTemplate>

<DataTemplate>

<Grid Canvas.Left="{Binding Mode=Default, XPath=left}" Canvas.Top="{Binding Mode=Default, XPath=top}">

<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Mode=Default, XPath=description}" TextWrapping="Wrap" FontSize="{Binding Mode=Default, XPath=fontSize}"/>

</Grid>

</DataTemplate>

</ListBox.ItemTemplate>

</ListBox>

</Grid>

</UserControl>

----------------------------------------------
-- Here's userData.xml
----------------------------------------------

 

<

 

 

userData>

 

<

 

 

cloudItems>

 

<

 

 

item>

 

<

 

 

description><![CDATA[This is item 1]]></description>

 

<

 

 

action><![CDATA[url or something?]]></action>

 

<

 

 

fontSize>12</fontSize>

 

<

 

 

top>50</top>

 

<

 

 

left>50</left>

 

</

 

 

item>

 

<

 

 

item>

 

<

 

 

description><![CDATA[This is item 2]]></description>

 

<

 

 

action><![CDATA[url or something?]]></action>

 

<

 

 

fontSize>18</fontSize>

 

<

 

 

top>100</top>

 

<

 

 

left>100</left>

 

</

 

 

item>

 

<

 

 

item>

 

<

 

 

description><![CDATA[This is item 3]]></description>

 

<

 

 

action><![CDATA[url or something?]]></action>

 

<

 

 

fontSize>24</fontSize>

 

<

 

 

top>150</top>

 

<

 

 

left>150</left>

 

</

 

 

item>

 

<

 

 

item>

 

<

 

 

description><![CDATA[This is item 4]]></description>

 

<

 

 

action><![CDATA[url or something?]]></action>

 

<

 

 

fontSize>36</fontSize>

 

<

 

 

top>200</top>

 

<

 

 

left>200</left>

 

</

 

 

item>

 

</

 

 

cloudItems>

 

</

 

 

userData>

 

Coordinator
Mar 23, 2009 at 4:10 PM
hm...
Jun 19, 2009 at 6:27 AM

Hey people please help me out here...

I need simple methods to make and manage groups of markers... in which i can both add and delete. Or does it need to be implemented still ?

Your reply will be highly appreciated. Thanks :)

Coordinator
Jun 19, 2009 at 8:06 AM
  • save each group on separate list
  • use marker tag as groupId
Sep 29, 2010 at 3:43 PM

The WinForms version of GMapMarker I have doesn't have the group property.  What version do I need to get to have that property?  Also, what is the latest stable version?

Coordinator
Sep 29, 2010 at 4:42 PM

latest is the only stable version ;}

Sep 29, 2010 at 4:48 PM

So where is this group property?? 

Coordinator
Sep 29, 2010 at 4:59 PM

there is no, you can use tag by default