Enhancing GMapControl (WPF)

Topics: WPF
Jul 30, 2010 at 5:40 PM

Hi Radioman!

While developing my own app I've faced with necessity to provide fast drawing of geometry primitives over map. The key requirements were:

1. Support 10000+ objects over map.

2. Support custom scaling for particular types of objects. Some of them do not scale (as GMapMarker), but some zoom.

That lead to a fork: http://greatmaps.codeplex.com/SourceControl/network/Forks/Iljas/GMapControlBaseInWPF

It contains GMapControlBase class and GMapControl (descendant of base). In GMapControlBase now there are necessary public properties and events. And all markers logic is now located within GMapControl.

Current version of my application perfectly zooms and pans map with 10000 objects over it.  But this is only possible if using custom overlay logic in my descendant of GMapControl:

        /// <summary>
        /// Layers.
        /// </summary>
        public VisualCollection Layers { get; private set; }

        /// <summary>
        /// Get number of children: VisualCollection count.
        /// </summary>
        protected override int VisualChildrenCount
                return base.VisualChildrenCount + Layers.Count;

        /// <summary>
        /// Get visual child - one of GraphicsBase objects
        /// </summary>
        protected override Visual GetVisualChild(int index)
            var baseCount = base.VisualChildrenCount;
            return index <= baseCount - 1 ? base.GetVisualChild(index) : Layers[index - baseCount];

Please take a look at this stuff.

It could possibly result in enhancing of performance for markers and other stuff in WPF version of GMapControl...


Jul 31, 2010 at 9:34 PM

hm.. are you sure that you pushed all changes back to server? I can't see any code of layers ;/

Aug 1, 2010 at 2:58 PM
I didn't push all my changes as they are very custom. Unfortunately I didn't succeed with any replacement for existing GMapMarkers approach (just due to lack of time...) I can send them to you via email, if you want.
Aug 1, 2010 at 10:05 PM

i see, there is no rush ;}