Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim CountyLocations(3) As Location
- CountyLocations(0) = New Location(55.852663, -2.3889276)
- CountyLocations(1) = New Location(55.956023, -3.1607265)
- CountyLocations(2) = New Location(54.840279, -3.2886766)
- CountyLocations(3) = New Location(52.819511, -1.8851815)
- For index = 0 to CountyLocations.Length - 1
- Dim Pin = New Microsoft.Maps.MapControl.WPF.Pushpin()
- Pin.Location = CountyLocations(index)
- UserControl11.BingMap.Children.Add(Pin)
- Next
- <Window x:Class="MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:wpf="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
- Title="MainWindow" Height="350" Width="525">
- <Grid>
- <wpf:Map x:Name="myMap" ZoomLevel="5" CredentialsProvider="My Key"
- Mode="Aerial" Center="55.852663, -2.3889276"></wpf:Map>
- </Grid>
- </Window>
- Imports Microsoft.Maps.MapControl.WPF
- Class MainWindow
- Public Sub New()
- InitializeComponent()
- CreatePushPinsWithToolTip()
- End Sub
- Private Sub CreatePushPinsWithToolTip()
- Dim CountyLocations(3) As Location
- CountyLocations(0) = New Location(55.852663, -2.3889276)
- CountyLocations(1) = New Location(55.956023, -3.1607265)
- CountyLocations(2) = New Location(54.840279, -3.2886766)
- CountyLocations(3) = New Location(52.819511, -1.8851815)
- For index = 0 To CountyLocations.Length - 1
- Dim Pin = New Microsoft.Maps.MapControl.WPF.Pushpin()
- Dim CoordinateTip As ToolTip = New ToolTip()
- CoordinateTip.Content = CountyLocations(index).ToString
- Pin.Location = CountyLocations(index)
- Pin.ToolTip = CoordinateTip
- myMap.Children.Add(Pin)
- Next
- End Sub
- End Class
- Private Sub CreatePushPinsWithToolTip()
- Dim CountyLocations(3) As Location
- CountyLocations(0) = New Location(55.852663, -2.3889276)
- CountyLocations(1) = New Location(55.956023, -3.1607265)
- CountyLocations(2) = New Location(54.840279, -3.2886766)
- CountyLocations(3) = New Location(52.819511, -1.8851815)
- Dim names = New String() {"sam", "tom", "leon", "eddy"}
- For index = 0 To CountyLocations.Length - 1
- Dim Pin = New Microsoft.Maps.MapControl.WPF.Pushpin()
- Dim CoordinateTip = New ToolTip()
- CoordinateTip.Content = names(index)
- Pin.Location = CountyLocations(index)
- Pin.ToolTip = CoordinateTip
- myMap.Children.Add(Pin)
- Next
- End Sub
Add Comment
Please, Sign In to add comment