This project has moved and is read-only. For the latest updates, please go here.

Center Location

Apr 25, 2016 at 3:46 AM
Is there a way to position the origin of the view elsewhere than at the exact center?

In case of real-time navigation, it's more interesting to have the origin at the lower center of the view so that the user can see what's coming ahead.
Apr 25, 2016 at 8:39 AM
Not permanently. MapBase has the public methods SetTransformOrigin(Location origin) and SetTransformOrigin(Point origin) to set a temporary origin of scale and rotate transforms, which is used e.g. during mouse wheel events or multi-touch zoom/rotate gestures. But this off-center origin point is reset as soon as a map manipulation event has ended or the Center property is set by application code. You may want to take a look at the source code on MapBase.cs. Maybe you find a way to tweak the transform origin code according to your needs.

That said, I would not agree with the general statement "it's more interesting to have the origin at the lower center". This would only apply to a heading-up navigation mode, but not to a north-up mode. I don't find XAML MapControl suitable for the former mode, because location labels in the map bitmaps would be shown rotated.
Apr 25, 2016 at 4:41 PM
Thanks for the quick reply.

I tried quickly SetTransformOrigin(Location origin) but never saw change in the view so I didn't go any further. I will have to dig deep in the transformation you use and I was trying to avoid that, deadlines and all.

To your other point, this is exactly what we do with the control, heading navigation with rotation. The labels are not very important, we're just making sure that we hit all the streets in an area by overlaying the vehicle trace with the map in real-time so we know which streets are to-do and which ones are done.