Few small problems - please help

trevorjdaniel

Member
Joined
Sep 24, 2009
Messages
8
Programming Experience
1-3
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...

Calculating a Route Using Bing Maps SOAP Services

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()'."

VB.NET:
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:

VB.NET:
' 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:

VB.NET:
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:

VB.NET:
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:

VB.NET:
MapLayer.SetPositionOrigin(point, PositionOrigin.Center)

I *think* this is something to do with the fact that the code example is not really silverlight code but I am not completely sure.

Can anyone help me get this going please?

Many thanks

Trev
 
Back
Top