locked
Bing Maps problem in WP7 RRS feed

  • Question

  • Hi,

    I am writing a wp7 silverlight app that uses the Bing Maps Webservice to calculate a route and display it on a map.I am using the code example from MS on this page...

    http://msdn.microsoft.com/en-us/library/ee681887.aspx

    I have managed to get the geocoding and routing functions to work just fine but I am getting problems trying to get the map to display the route...

    For example, the following lines throw an error of "Too many arguments to 'Public Sub New()'."

    For Each p As Location In e.Result.Result.RoutePath.Points
    
      routeLine.Locations.Add(New Location(p.Latitude, p.Longitude))
    
    Next p
    
    

    I then get an error of "Overload resolution failed because no accessible 'New' accepts this number of arguments." at this line of code:

    ' Figure the rectangle which encompasses the route. This is used later to set the map view.
    
    Dim rect As New LocationRect(routeLine.Locations(0), routeLine.Locations(routeLine.Locations.Count - 1))
    
    

    Again, further down I get the error message of "Too many arguments to 'Public Sub New()'." at this line of code:

    Dim location_Renamed As New Location(gr.Locations(0).Latitude, gr.Locations(0).Longitude)
    
    

    Then i get the error "SetPosition' is not a member of 'Microsoft.Phone.Controls.Maps.MapLayer'" at this line of code:

    MapLayer.SetPosition(point, location_Renamed)
    
    

    Then i get the error of "'SetPositionOrigin' is not a member of 'Microsoft.Phone.Controls.Maps.MapLayer'" at this line of code:

    MapLayer.SetPositionOrigin(point, PositionOrigin.Center)
    
    

    Can anyone help me get this going please?

    Many thanks

    Trev
    Monday, November 1, 2010 11:01 AM

Answers

  • Wrong forum. Here's correct one: http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/threads
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, November 1, 2010 3:40 PM