jj 15.3 geo data zoomlevel

This commit is contained in:
JenneJ
2017-03-15 12:25:14 +01:00
parent d92e9b8586
commit 8f7f9e6cd5
2 changed files with 59 additions and 1 deletions

View File

@@ -34,6 +34,9 @@ Public Class frmGeodataSelect
dataProvider.BingKey = BING_KEY
ImageLayer.DataProvider = dataProvider
Dim XMLPath = Get_Settings_Filename()
Dim layout As New ClassLayout(XMLPath)
Dim storage As New MapItemStorage()
VectorLayer.Data = storage
@@ -45,7 +48,14 @@ Public Class frmGeodataSelect
txtLat.Text = SelectedPoint.Latitude.ToString()
txtLon.Text = SelectedPoint.Longitude.ToString()
MapControl1.ZoomLevel = 7
Dim zoomLevel = layout.GetValue("MapControlSelect_ZoomLevel")
If IsNothing(zoomLevel) Then
MapControl1.ZoomLevel = 10.0
Else
MapControl1.ZoomLevel = Double.Parse(zoomLevel)
End If
MapControl1.ZoomToFit(New List(Of MapPushpin) From {pin})
End If
@@ -77,10 +87,22 @@ Public Class frmGeodataSelect
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
Dim XMLPath = Get_Settings_Filename()
Dim layout As New ClassLayout(XMLPath)
Dim settings As New System.Collections.Generic.List(Of ClassSetting)
settings = layout.Load()
layout.PutValue("MapControlSelect_ZoomLevel", MapControl1.ZoomLevel)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Function Get_Settings_Filename()
Dim Filename As String = String.Format("{0}-Geodata-Layout.xml", CURRENT_CONSTRUCTOR_ID)
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
End Function
Private Sub tsbtnactivate_Click(sender As Object, e As EventArgs) Handles tsbtnactivate.Click
If _SelectActive = False Then
_SelectActive = True