Control problems?!

Dec 1, 2009 at 9:23 AM


Now that i know how to solve what i want i start all over. This time in WPF.

After starting up a new project i have tried to drag the control to my frame. But can not get control on frame.

It is in my toolbar, i have added the references to the DLL's.

What can be wrong??




Dec 1, 2009 at 9:26 AM

no idea, try just include control namespace in xaml

Dec 1, 2009 at 12:16 PM


Disposed the project and started a new one in same matter.

Strange but true.


Dec 1, 2009 at 5:26 PM

and it worked? .i know in windows form can be Design mode detection issues, but on wpf it should work well

Dec 2, 2009 at 12:05 PM

Yes it is working now. But now i encounter problems due to differences between Windows.Forms and WPF. In Windows forms i could draw shapes on gmapcontrol but in WPF i can not draw on gmapcontrol.(don't know how)  In Windows.Forms i could use handle of gmapcontrol to "connect" graphics to gmapcontrol. But i don't know how to do this is WPF. I have looked in your WPF demo but couldn't find out how you do the circle trick. (how hard can it be???) again) any help from your side?




Dec 2, 2009 at 12:08 PM

well it's just a circle shape added to markers, check functions in demo:

  • AddDemoZone
  • UpdateCircle

quite easy ;}

Dec 2, 2009 at 1:48 PM

Quite easy....

I have tried to figure out, but still don't know how to set my drawn polygon as a marker, or how to set a marker as a polygon...

So probably i am stupid because still not working




Dec 2, 2009 at 3:14 PM

probably, you need to create some visual(via xaml or in code) and use it as a marker ;}

Dec 2, 2009 at 3:38 PM

This is what i have so far

Dim myMarker As GMapMarker = New GMap.NET.WindowsPresentation.GMapMarker(myPoint)
Dim myPolygon As New Polygon()
myPolygon.Stroke = System.Windows.Media.Brushes.Black
myPolygon.Fill = System.Windows.Media.Brushes.LightSeaGreen
myPolygon.StrokeThickness = 2
myPolygon.HorizontalAlignment = HorizontalAlignment.Left
myPolygon.VerticalAlignment = VerticalAlignment.Center
myPolygon.Points = myPointCollection
' myPoint is lat/lng coordinate
' myPointCollection is filled with latlngtolocal coordinates
Code gives error: Objectreference not set to instance of an object
Any idea?
Dec 2, 2009 at 3:48 PM
myMarker.Shape.TransformToVisual(myPolygon) wtf? ;}
Dec 2, 2009 at 4:34 PM

myMarker.shape = myPolygon did the job.


Dec 2, 2009 at 5:34 PM

Complety working now, including zoom and opacity.

As always not to difficult at the at.......


Dec 2, 2009 at 5:36 PM

great! Keep going ;}

Dec 3, 2009 at 4:27 PM


Can you please share how you implemented zoom? I assume it's a variation of the WPF Demo's UpdateCircle?

Thanks for your consideration.

Dec 3, 2009 at 4:32 PM


What is do is:

1) Obtain a list of the coordinates which present my polygon

2) read coordinates and draw polygon

When zooming repeat step 2


For me this is the easiest way. Building and drawing polygon is just fraction of second.

If you like i can share code with you.



Dec 3, 2009 at 4:35 PM

yes, and you can use FromLatLngToLocal for building the polygon

Dec 4, 2009 at 5:35 PM

Heru, as you offered in you last post, can you please share your code?