Funny I messagebox a count and I am getting 11....dosent seem right...well maybe the geocoder is grabbing 11 and then grabbing the first with this: Dim address As AddressCandidate = e.Results(0)
Private Sub locator_AddressToLocationsCompleted(ByVal sender As Object, ByVal e As AddressToLocationsEventArgs)
Dim graphicsLayer As GraphicsLayer = (TryCast(MyMap.Layers("MyRouteGraphicsLayer"), GraphicsLayer))
If e.Results.Count > 0 Then
Dim address As AddressCandidate = e.Results(0)
Dim graphicLocation As New Graphic() With {.Geometry = address.Location}
graphicLocation.Attributes.Add("address", address.Address)
graphicLocation.Attributes.Add("score", address.Score)
_stops.Add(graphicLocation)
MessageBox.Show("Count")
MessageBox.Show(e.Results.Count)
If CStr(e.UserState) Is "from" Then
MessageBox.Show("From")
graphicLocation.Symbol = TryCast(LayoutRoot.Resources("FromSymbol"), Symbols.Symbol)
'graphicLocation.Symbol = TryCast(LayoutRoot.Resources("DefaultMarkerSymbol"), Symbols.Symbol)
'Geocode to address
_locator.AddressToLocationsAsync(ParseAddress(ToTextBox.Text), "to")
Else
I then tried to eliminate the If then by doign this....and still nothing....
Dim graphicLocation As New Graphic() With {.Geometry = address.Location, .Symbol = LayoutRoot.Resources("FromSymbol")}