MapViewer - How to display Multiple Pins from text

I have the example MapViewer and have attempted several ways to add multiple Pins using a text string in LocationField.

Here is the latest modification

[code]If CurrentLocation<>Nil Then
// If we already have a location, remove it from the map
CurrentLocation.Visible = False
End If

// Update the CurrentLocation object to reflect the entered address
If LocationField.Text = “” Then
MsgBox “You need to add a location in the location field”

Dim my_arr(-1) As String = LocationField.Text.Split(",")
Dim x As Integer

'my_arr = LocationField.Text.Split(",")
If Ubound(my_arr) > 0 Then

For x = 0 to Ubound(my_arr)
    CurrentLocation = New WebMapLocation(my_arr(x))
    'CurrentLocation.Visible = True
    Dim loc As New WebMapLocation(MapLocation.latitude, MapLocation.longitude, CStr(Ticks))
    If UseCustomIconCheck.Value Then
      loc.Icon = pin
    End If
    If UseAnimationCheck.Value Then
      loc.Animated = True
    End If
    loc.Visible = True
    If x = 0 Then MapLocation.GoToLocation(CurrentLocation)
    CurrentLocation.Visible = False
  Catch err As NilObjectException
    MsgBox " The address " + my_arr(x) + " was not found"
  End Try

CurrentLocation = New WebMapLocation(LocationField.Text)
CurrentLocation.Visible = True

Catch err As NilObjectException
  MsgBox "You need to add a location in the location field"
End Try


I used the info from the Click event however this does not display any locations. I am using a ‘,’ as a separator field and am forcing all to CAPS

Any suggestions?


Yeah, use more than one instance of webmaplocation. By putting them all into CurrentLocation, you’re effectively overwriting the previous values.

How would I create more than one instance that would be determined by Ubound(my_arr) of the Property ‘CurrentLocation’ defined as a WebMapLocation