none
[UWA][MapControl] Getting Session ID from MapControl or Bing Map Key? RRS feed

  • Question

  • Hi all,

    According to this page (https://msdn.microsoft.com/en-us/library/ff859477.aspx), most of the Bing Maps transaction can become non-billable when using the Session ID of the MapControl of Universal Windows Apps.

    However I don't know how to get that session ID?

    I can do MapSevice.ServiceToken = "my key" and I think that MapLocationFinder request become non-billable. But for my can I would like to use the BingMap REST Elevation API as this API is not implemented in Universal Windows Apps API.

    BasicGeoposition.Altitude is always 0.

    Do you know if it is possible to get the session ID of the MapControl in order to call Bing Map REST API with non-billable transactions?

    Thanks for any help.

    Thursday, November 26, 2015 10:58 AM

Answers

  • I don't think there's a way to do this. When using the Win10 map control, any transactions to route or search through the services namespace automatically use the session for you, so the session was never exposed. There currently isn't an elevation API on the map control (although it does have the elevation information available locally). There may be a workaround - if you're in Aerial3D mode, you can use tryPixelToLocation and it should return values with elevation.
    • Marked as answer by DBriard Thursday, December 10, 2015 11:54 AM
    Wednesday, December 2, 2015 6:07 PM
    Moderator

All replies

  • I don't think there's a way to do this. When using the Win10 map control, any transactions to route or search through the services namespace automatically use the session for you, so the session was never exposed. There currently isn't an elevation API on the map control (although it does have the elevation information available locally). There may be a workaround - if you're in Aerial3D mode, you can use tryPixelToLocation and it should return values with elevation.
    • Marked as answer by DBriard Thursday, December 10, 2015 11:54 AM
    Wednesday, December 2, 2015 6:07 PM
    Moderator
  • Thank you duncan for the possible workaround. I hope the elevation api is on the developper roadmap...
    Thursday, December 10, 2015 11:55 AM