jj 17.11
This commit is contained in:
@@ -5,6 +5,11 @@ Imports DevExpress.Map
|
||||
|
||||
Public Class frmGoogle
|
||||
|
||||
Public Sub New()
|
||||
InitializeComponent()
|
||||
|
||||
mapControl1.SetMapItemFactory(New MapItemFactory())
|
||||
End Sub
|
||||
|
||||
'##################### SEARCH ##############################
|
||||
'Private ReadOnly Property SearchLayer() As InformationLayer
|
||||
@@ -27,17 +32,16 @@ Public Class frmGoogle
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private ReadOnly Property ItemStorage() As MapItemStorage
|
||||
Get
|
||||
Return CType(VectorLayer.Data, MapItemStorage)
|
||||
End Get
|
||||
End Property
|
||||
'Private Property ItemStorage() As MapItemStorage
|
||||
' Get
|
||||
' Return CType(VectorLayer.Data, MapItemStorage)
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
|
||||
Private Sub frmGoogle_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
'Events
|
||||
AddHandler MapControl1.MapItemClick, AddressOf MapControl1_MapItemClick
|
||||
|
||||
Dim items As New List(Of MapPushpin)
|
||||
|
||||
MapControl1.ShowToolTips = True
|
||||
MapControl1.SetMapItemFactory(New MapItemFactory())
|
||||
@@ -61,21 +65,28 @@ Public Class frmGoogle
|
||||
pushpin.Location = New GeoPoint(lat, lon)
|
||||
pushpin.Text = row.Item("Record-ID")
|
||||
pushpin.Information = row
|
||||
|
||||
pushpin.TextColor = Color.Aqua
|
||||
|
||||
pushpin.Attributes.Add(New MapItemAttribute() With {.Name = "SNumber", .Type = GetType(String), .Value = row.Item("Supplier_number")})
|
||||
pushpin.Attributes.Add(New MapItemAttribute() With {.Name = "SName", .Type = GetType(String), .Value = row.Item("Supplier_name")})
|
||||
|
||||
pushpin.ToolTipPattern = "Supplier Name: {SName} - Supplier Number: {SNumber}"
|
||||
ItemStorage.Items.Add(pushpin)
|
||||
|
||||
items.Add(pushpin)
|
||||
|
||||
lat += 0.01
|
||||
lon += 0.01
|
||||
Next
|
||||
|
||||
Dim storage As New MapItemStorage()
|
||||
Dim itemArray() As MapPushpin = items.ToArray()
|
||||
|
||||
storage.Items.AddRange(itemArray)
|
||||
VectorLayer.Data = storage
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MapControl1_MapItemClick(sender As Object, e As MapItemClickEventArgs)
|
||||
Private Sub MapControl1_MapItemClick(sender As Object, e As MapItemClickEventArgs) Handles MapControl1.MapItemClick
|
||||
Dim item As MapPushpin = e.Item
|
||||
Dim row As DataRow = item.Information
|
||||
Dim attrs As MapItemAttributeCollection = item.Attributes
|
||||
@@ -88,13 +99,11 @@ Public Class frmGoogle
|
||||
End Sub
|
||||
|
||||
Private Sub MapControl1_DrawMapItem(sender As Object, e As DrawMapItemEventArgs) Handles MapControl1.DrawMapItem
|
||||
Dim colorOuter As Color = Color.White
|
||||
Dim colorInner As Color = Color.Blue
|
||||
Dim colorOuter As Color = Color.Green
|
||||
Dim colorInner As Color = Color.Green
|
||||
Dim colorInnerHighlight As Color = Color.Red
|
||||
|
||||
e.Fill = If(e.IsSelected Or e.IsHighlighted, colorInnerHighlight, colorInner)
|
||||
e.Stroke = colorOuter
|
||||
e.StrokeWidth = If(e.IsSelected, 5, 2)
|
||||
e.Fill = Color.Red
|
||||
End Sub
|
||||
|
||||
Public Class MapItemFactory
|
||||
|
||||
Reference in New Issue
Block a user