PositionOrigin RRS feed

  • Question

  • I'm porting a MS Surface app to Metro style and am having trouble finding a way to add my own image pin to a map layer such that it is positioned with its bottom center on the Location.

    In Bing Maps for WPF, there was a way to MapLayer.AddChild(image, Location, PositionOrigin.BottomCenter) so that the image which represented a pin would have its bottom center (pin tip) at the assigned Location.

    Currently, we are simply calling the available static method MapLayer.SetPosition(image, Location).  There doesn't seem to be a way to direct it to place the bottom center of the image at the Location.


    Tuesday, July 3, 2012 4:51 PM


All replies

  • MapLayer.SetPositionAnchor will do what you want.
    Tuesday, July 3, 2012 5:02 PM
  • Thanks though I much preferred the PositionOrigin enumerator provided by Bing Maps WPF so I didn't have to keep mess around with image sizes.
    Tuesday, July 3, 2012 8:41 PM
  • It wasn't possible to accomplish the same in Windows 8; custom type converters are not allowed. We would have to either go with the enumeration or with pixel precision. Pixel precision is a little more work but allows you to get the exact position you want instead of being limited to 9 relative positions.
    Wednesday, July 4, 2012 12:02 AM