none
REST services API namespace? RRS feed

  • Question

  • I have successfully written code to access the REST services for finding a route between two points, and now I'm building the UI for it (similar to the one in the built-in Bing Maps app). To build that UI, I need to be able to map strings appearing in the response to the corresponding classes/enumerations. For example, there are strings in itinerary entries corresponding to the ManeuverType enumeration, and I don't want the UI layer to have to know about those particular strings - I want it to get an actual ManeuverType enum.

    The problem is that I don't know where the class definitions are - they don't seem to be in the namespace for the Bing Maps API. Are those classes available, and if so how do I access them?

    Thanks,

    Mark Peters

    Thursday, September 27, 2012 3:49 PM

Answers

  • There is no class definitions for those properties. They are strings. What you can do is create a converter to convert the strings into an enum or into another object if you want. A switch statement on the string works well.

    http://rbrundritt.wordpress.com

    • Marked as answer by Mark Peters Thursday, September 27, 2012 4:09 PM
    Thursday, September 27, 2012 3:57 PM

All replies

  • There is no class definitions for those properties. They are strings. What you can do is create a converter to convert the strings into an enum or into another object if you want. A switch statement on the string works well.

    http://rbrundritt.wordpress.com

    • Marked as answer by Mark Peters Thursday, September 27, 2012 4:09 PM
    Thursday, September 27, 2012 3:57 PM
  • That's what I'm doing now, but I was hoping that I could access the ManeuverType enum documented here so that my switch could at least work off a published API, and hence at worst would only need to be recompiled if the enum changes.

    May I assume that the existing values will never change, and that new ones will be added and no-longer-used values will just stop showing up in the response?

    Thanks,

    Mark Peters

    Thursday, September 27, 2012 4:18 PM