ThinkGeo.com    |     Blog    |     Wiki    |     Support

Drawing shape directly on canvas

Is there a way to draw a shape directly on the map’s canvas? I know if you’re ovrriding a style’s drawcore function you can do canvas.DrawLine, etc. What if I just have the map object and want to draw a simple line on the map without creating a feature? Is there some kind of .Draw function that I’m missing?

Hi Dan,

We don’t have an API to directly draw line on map, could you please let us know your detail requirement here?

If you want to draw a line by code, you can add it into an InmemoryFeatureLayer, and if you want to draw it by mouse, you can choose our EditOverlay.

But because for WPF our map is a control, if you want to draw on it via canvas, I think you can add your custom control into our map, and draw on the canvas of your control.

Wish that’s helpful.

Regards,

Ethan