ThinkGeo.com    |     Documentation    |     Premium Support

Question about overlays

Hello, I’m hoping you can help me understand when to use which overlay.

Currently I have an application that is essentially a gps tracker, only instead of using a single marker to show a position, I’m drawing a polygon to scale based on calculations given a point, and dimensions of the object being tracked. From the given gps point, I’m calculating the necessary positions to represent the object on the map.

Now, currently I’m storing these features in an InMemoryFeatureLayer, which is in a basic LayerOverlay.
I’ve been looking at the latest HowDoI samples, specifically the VehicleNavigation sample, and noticed that it is making use of FeatureLayerWpfDrawingOverlay, which got me wondering if that’s something I should be using instead.

I haven’t really found much documentation (other than the basic api docs) that explain what each overlay type is for and which should be used when, so I’m hoping you can provide some insight.

1 Like

Hi Aaron,

I think FeatureLayerWpfDrawingOverlay would fit your case better. The main differences are:

LayerOverlay

  1. All layers are first rendered to an off-screen bitmap, and that bitmap is then displayed on the map.
    Layer → Bitmap → Map Canvas
  2. During panning/zooming, it stretches the existing image and only redraws after the interaction finishes.

FeatureLayerWpfDrawingOverlay

  1. Renders FeatureLayers directly onto the WPF canvas instead of using a bitmap.
    FeatureLayer → WPF Canvas
  2. Features are rendered in real time during panning/zooming.

Since your scenario only involves one GPS feature that updates frequently, FeatureLayerWpfDrawingOverlay should be the better option.

Here https://thinkgeo.com/blog/desktop-animations also talked a bit about how to use FeatureLayerWpfDrawingOverlay for better labeling if you are interested.

Thanks,
Ben