You've already forked lazarus-ccr
LazMapViewer: Add import/export of map providers to/from xml file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6839 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -12,28 +12,27 @@ object MainForm: TMainForm
|
|||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.1.0.0'
|
||||||
object ControlPanel: TPanel
|
object ControlPanel: TPanel
|
||||||
Left = 632
|
Left = 592
|
||||||
Height = 545
|
Height = 545
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 237
|
Width = 277
|
||||||
Align = alRight
|
Align = alRight
|
||||||
ClientHeight = 545
|
ClientHeight = 545
|
||||||
ClientWidth = 237
|
ClientWidth = 277
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object CbProviders: TComboBox
|
object CbProviders: TComboBox
|
||||||
AnchorSideLeft.Control = LblProviders
|
AnchorSideLeft.Control = LblProviders
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = ControlPanel
|
AnchorSideTop.Control = ControlPanel
|
||||||
AnchorSideRight.Control = ControlPanel
|
AnchorSideRight.Control = BtnLoadMapProviders
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 69
|
Left = 69
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 9
|
Top = 9
|
||||||
Width = 159
|
Width = 145
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 8
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 4
|
||||||
DropDownCount = 24
|
DropDownCount = 24
|
||||||
ItemHeight = 15
|
ItemHeight = 15
|
||||||
OnChange = CbProvidersChange
|
OnChange = CbProvidersChange
|
||||||
@ -89,7 +88,7 @@ object MainForm: TMainForm
|
|||||||
Left = 69
|
Left = 69
|
||||||
Height = 40
|
Height = 40
|
||||||
Top = 59
|
Top = 59
|
||||||
Width = 167
|
Width = 207
|
||||||
Max = 17
|
Max = 17
|
||||||
Min = 1
|
Min = 1
|
||||||
OnChange = ZoomTrackBarChange
|
OnChange = ZoomTrackBarChange
|
||||||
@ -114,18 +113,18 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Control = LblProviders
|
AnchorSideLeft.Control = LblProviders
|
||||||
AnchorSideTop.Control = ZoomTrackBar
|
AnchorSideTop.Control = ZoomTrackBar
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = CbProviders
|
AnchorSideRight.Control = BtnSaveMapProviders
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 9
|
Left = 9
|
||||||
Height = 66
|
Height = 66
|
||||||
Top = 107
|
Top = 107
|
||||||
Width = 219
|
Width = 259
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 8
|
||||||
Caption = 'Mouse position'
|
Caption = 'Mouse position'
|
||||||
ClientHeight = 46
|
ClientHeight = 46
|
||||||
ClientWidth = 215
|
ClientWidth = 255
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
object LblPositionLongitude: TLabel
|
object LblPositionLongitude: TLabel
|
||||||
AnchorSideLeft.Control = CbMouseCoords
|
AnchorSideLeft.Control = CbMouseCoords
|
||||||
@ -158,7 +157,7 @@ object MainForm: TMainForm
|
|||||||
AnchorSideTop.Control = CbMouseCoords
|
AnchorSideTop.Control = CbMouseCoords
|
||||||
AnchorSideRight.Control = CbMouseCoords
|
AnchorSideRight.Control = CbMouseCoords
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 165
|
Left = 205
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 4
|
Top = 4
|
||||||
Width = 34
|
Width = 34
|
||||||
@ -175,7 +174,7 @@ object MainForm: TMainForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = CbMouseCoords
|
AnchorSideRight.Control = CbMouseCoords
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 165
|
Left = 205
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 23
|
Top = 23
|
||||||
Width = 34
|
Width = 34
|
||||||
@ -192,18 +191,18 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Control = LblProviders
|
AnchorSideLeft.Control = LblProviders
|
||||||
AnchorSideTop.Control = CbMouseCoords
|
AnchorSideTop.Control = CbMouseCoords
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = CbProviders
|
AnchorSideRight.Control = CbMouseCoords
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 9
|
Left = 9
|
||||||
Height = 66
|
Height = 66
|
||||||
Top = 185
|
Top = 185
|
||||||
Width = 219
|
Width = 259
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 12
|
BorderSpacing.Top = 12
|
||||||
Caption = 'Center'
|
Caption = 'Center'
|
||||||
ClientHeight = 46
|
ClientHeight = 46
|
||||||
ClientWidth = 215
|
ClientWidth = 255
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
object LblCenterLongitude: TLabel
|
object LblCenterLongitude: TLabel
|
||||||
AnchorSideLeft.Control = GbCenterCoords
|
AnchorSideLeft.Control = GbCenterCoords
|
||||||
@ -236,7 +235,7 @@ object MainForm: TMainForm
|
|||||||
AnchorSideTop.Control = GbCenterCoords
|
AnchorSideTop.Control = GbCenterCoords
|
||||||
AnchorSideRight.Control = GbCenterCoords
|
AnchorSideRight.Control = GbCenterCoords
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 165
|
Left = 205
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 4
|
Top = 4
|
||||||
Width = 34
|
Width = 34
|
||||||
@ -253,7 +252,7 @@ object MainForm: TMainForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = GbCenterCoords
|
AnchorSideRight.Control = GbCenterCoords
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 165
|
Left = 205
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 23
|
Top = 23
|
||||||
Width = 34
|
Width = 34
|
||||||
@ -274,7 +273,7 @@ object MainForm: TMainForm
|
|||||||
Left = 9
|
Left = 9
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 264
|
Top = 264
|
||||||
Width = 150
|
Width = 190
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
BorderSpacing.Bottom = 4
|
BorderSpacing.Bottom = 4
|
||||||
@ -286,9 +285,9 @@ object MainForm: TMainForm
|
|||||||
object BtnSearch: TButton
|
object BtnSearch: TButton
|
||||||
AnchorSideTop.Control = GbCenterCoords
|
AnchorSideTop.Control = GbCenterCoords
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = CbProviders
|
AnchorSideRight.Control = GbCenterCoords
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 167
|
Left = 207
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 263
|
Top = 263
|
||||||
Width = 61
|
Width = 61
|
||||||
@ -307,7 +306,7 @@ object MainForm: TMainForm
|
|||||||
Left = 9
|
Left = 9
|
||||||
Height = 21
|
Height = 21
|
||||||
Top = 318
|
Top = 318
|
||||||
Width = 156
|
Width = 196
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
@ -337,7 +336,7 @@ object MainForm: TMainForm
|
|||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = BtnSearch
|
AnchorSideRight.Control = BtnSearch
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 173
|
Left = 213
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 316
|
Top = 316
|
||||||
Width = 55
|
Width = 55
|
||||||
@ -356,7 +355,7 @@ object MainForm: TMainForm
|
|||||||
Left = 8
|
Left = 8
|
||||||
Height = 52
|
Height = 52
|
||||||
Top = 380
|
Top = 380
|
||||||
Width = 220
|
Width = 260
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 8
|
||||||
@ -386,20 +385,120 @@ object MainForm: TMainForm
|
|||||||
Left = 8
|
Left = 8
|
||||||
Height = 80
|
Height = 80
|
||||||
Top = 432
|
Top = 432
|
||||||
Width = 220
|
Width = 260
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
Caption = 'GPSPointInfo'
|
Caption = 'GPSPointInfo'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
end
|
end
|
||||||
|
object BtnLoadMapProviders: TSpeedButton
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = CbProviders
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = BtnSaveMapProviders
|
||||||
|
Left = 218
|
||||||
|
Height = 22
|
||||||
|
Top = 9
|
||||||
|
Width = 23
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.Right = 4
|
||||||
|
Glyph.Data = {
|
||||||
|
36040000424D3604000000000000360000002800000010000000100000000100
|
||||||
|
2000000000000004000064000000640000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000003591
|
||||||
|
DBFA439FDDFA439FDDFA429FDDFA429EDDFA419EDCFA419EDCFA419EDCFA419E
|
||||||
|
DCFA419EDCFA419EDCFA419EDCFA3792DAFB3080DF100000000000000000429C
|
||||||
|
DEF76EC7EBFF6DC7EAFF6BC6EAFF6AC5E9FF68C4E9FF67C3E8FF65C2E8FF64C1
|
||||||
|
E7FF63C0E7FF61BFE6FF60BEE5FF51AFE3FE308CD6450000000000000000409A
|
||||||
|
DDF47CD0F1FF7BD0F0FF7ACFEFFF79CEEFFF77CDEEFF76CCEEFF74CBEDFF73CA
|
||||||
|
EDFF71C9ECFF70C8ECFF6EC7EBFF6AC3E9FF3993DB8E00000000000000003E99
|
||||||
|
DCEC7ECEF1FF8AD9F6FF89D8F5FF87D7F4FF86D6F4FF84D5F3FF83D5F3FF81D4
|
||||||
|
F2FF80D3F2FF7ED2F1FF7DD1F1FF7BD0F0FF439ADEB40000000000000000409B
|
||||||
|
DDE470C1EDFF99E2FBFF97E2FBFF96E1FAFF94E0F9FF93DFF9FF91DEF8FF90DD
|
||||||
|
F8FF8EDCF7FF8DDBF7FF8CDAF6FF8AD9F6FF4EA4E2CD00000000000000004AA5
|
||||||
|
E0DF61B3E8FFA3E9FFFFA3E9FFFFA3E9FFFFA3E9FFFFA2E8FEFFA0E7FEFF9FE6
|
||||||
|
FDFF9DE5FDFF9CE4FCFF9AE3FCFF99E2FBFF5FB3E9E33080DF100000000051A8
|
||||||
|
E2DF5EB2E8FFA3E9FFFFA3E9FFFFA3E9FFFFA3E9FFFFA3E9FFFFA3E9FFFFA3E9
|
||||||
|
FFFFA3E9FFFFA3E9FFFFA3E9FFFFA3E9FFFF84CFF5FB348CDA450000000058AD
|
||||||
|
E5DF60B3E8FF61B3E9FF61B3E9FF60B2E9FF60B2E8FF60B2E8FF5FB1E8FF5FB1
|
||||||
|
E8FF5EB1E8FF5EB1E8FF5EB1E7FF59ADE7FB55A9E5E33B94DC85000000005FB0
|
||||||
|
E8DF9DE4FBFF9AE3FAFF97E1F9FF94DFF8FF91DDF7FF8EDBF5FF8BD9F4FF88D8
|
||||||
|
F3FF85D6F2FF82D4F1FF7FD2F0FF4FA7E1DF00000000000000000000000061B1
|
||||||
|
E8DFA6EAFFFFA6EAFFFFA6EAFFFFA3E8FEFF7AC6F1ED59ACE6DF58AAE5DF57AA
|
||||||
|
E5DF56AAE5DF53A9E4DF53A8E4DF3C94DCE20000000000000000000000004096
|
||||||
|
DEE25DAEE7DF5DAEE7DF5DAEE7DF57A9E6DF4399DF6E00000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000
|
||||||
|
}
|
||||||
|
OnClick = BtnLoadMapProvidersClick
|
||||||
|
end
|
||||||
|
object BtnSaveMapProviders: TSpeedButton
|
||||||
|
AnchorSideLeft.Control = BtnLoadMapProviders
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = CbProviders
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = ControlPanel
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 245
|
||||||
|
Height = 22
|
||||||
|
Top = 9
|
||||||
|
Width = 23
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.Right = 8
|
||||||
|
Glyph.Data = {
|
||||||
|
36040000424D3604000000000000360000002800000010000000100000000100
|
||||||
|
2000000000000004000064000000640000000000000000000000A4653455A465
|
||||||
|
34FFA46534FFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BD
|
||||||
|
BAFFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFA465
|
||||||
|
34FFA46534FFB6BDBAFFA46534FFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BD
|
||||||
|
BAFFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFA465
|
||||||
|
34FFA46534FFB6BDBAFFA46534FFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BD
|
||||||
|
BAFFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFA465
|
||||||
|
34FFA46534FFB6BDBAFFA46534FFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BD
|
||||||
|
BAFFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFA465
|
||||||
|
34FFA46534FFB6BDBAFFA46534FFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BD
|
||||||
|
BAFFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFA465
|
||||||
|
34FFA46534FFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BDBAFFB6BD
|
||||||
|
BAFFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFA465
|
||||||
|
34FFA46534FFA46534FFA46534FFA46534FFA46534FFA46534FFA46534FFA465
|
||||||
|
34FFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFA465
|
||||||
|
34FFA46534FFA46534FFA46534FFA46534FFA46534FFA46534FFA46534FFA465
|
||||||
|
34FFA46534FFA46534FFA46534FFA46534FFA46534FF00000000A46534FFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFA46534FF00000000A46534FFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFA46534FF00000000A46534FFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFA46534FF00000000A46534FFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFA46534FF00000000A46534FFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFA46534FF00000000A46534FFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFECEE
|
||||||
|
EEFFECEEEEFFECEEEEFFECEEEEFFECEEEEFFA46534FF00000000A46534FF5959
|
||||||
|
F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959
|
||||||
|
F3FF5959F3FF5959F3FF5959F3FF5959F3FFA46534FF00000000A46534FF5959
|
||||||
|
F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959F3FF5959
|
||||||
|
F3FF5959F3FF5959F3FF5959F3FF5959F3FFA46534FF00000000
|
||||||
|
}
|
||||||
|
OnClick = BtnSaveMapProvidersClick
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object MapView: TMapView
|
object MapView: TMapView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 545
|
Height = 545
|
||||||
Hint = 'Displays the map'
|
Hint = 'Displays the map'
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 632
|
Width = 592
|
||||||
Active = False
|
Active = False
|
||||||
Align = alClient
|
Align = alClient
|
||||||
CacheOnDisk = True
|
CacheOnDisk = True
|
||||||
|
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Types, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, Types, Forms, Controls, Graphics, Dialogs,
|
||||||
ExtCtrls, StdCtrls, ComCtrls,
|
ExtCtrls, StdCtrls, ComCtrls, Buttons,
|
||||||
mvGeoNames, mvMapViewer, mvTypes, mvGpsObj;
|
mvGeoNames, mvMapViewer, mvTypes, mvGpsObj;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -40,6 +40,8 @@ type
|
|||||||
MapView: TMapView;
|
MapView: TMapView;
|
||||||
GeoNames: TMVGeoNames;
|
GeoNames: TMVGeoNames;
|
||||||
ControlPanel: TPanel;
|
ControlPanel: TPanel;
|
||||||
|
BtnLoadMapProviders: TSpeedButton;
|
||||||
|
BtnSaveMapProviders: TSpeedButton;
|
||||||
ZoomTrackBar: TTrackBar;
|
ZoomTrackBar: TTrackBar;
|
||||||
procedure BtnGoToClick(Sender: TObject);
|
procedure BtnGoToClick(Sender: TObject);
|
||||||
procedure BtnSearchClick(Sender: TObject);
|
procedure BtnSearchClick(Sender: TObject);
|
||||||
@ -60,6 +62,8 @@ type
|
|||||||
procedure MapViewMouseUp(Sender: TObject; Button: TMouseButton;
|
procedure MapViewMouseUp(Sender: TObject; Button: TMouseButton;
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Shift: TShiftState; X, Y: Integer);
|
||||||
procedure MapViewZoomChange(Sender: TObject);
|
procedure MapViewZoomChange(Sender: TObject);
|
||||||
|
procedure BtnLoadMapProvidersClick(Sender: TObject);
|
||||||
|
procedure BtnSaveMapProvidersClick(Sender: TObject);
|
||||||
procedure ZoomTrackBarChange(Sender: TObject);
|
procedure ZoomTrackBarChange(Sender: TObject);
|
||||||
|
|
||||||
private
|
private
|
||||||
@ -94,6 +98,7 @@ type
|
|||||||
const
|
const
|
||||||
MAX_LOCATIONS_HISTORY = 50;
|
MAX_LOCATIONS_HISTORY = 50;
|
||||||
HOMEDIR = '';
|
HOMEDIR = '';
|
||||||
|
MAP_PROVIDER_FILENAME = 'map-providers.xml';
|
||||||
|
|
||||||
var
|
var
|
||||||
PointFormatSettings: TFormatsettings;
|
PointFormatSettings: TFormatsettings;
|
||||||
@ -106,15 +111,31 @@ end;
|
|||||||
|
|
||||||
{ TMainForm }
|
{ TMainForm }
|
||||||
|
|
||||||
|
procedure TMainForm.BtnLoadMapProvidersClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
fn: String;
|
||||||
|
msg: String;
|
||||||
|
begin
|
||||||
|
fn := Application.Location + MAP_PROVIDER_FILENAME;
|
||||||
|
if FileExists(fn) then begin
|
||||||
|
if MapView.Engine.ReadProvidersFromXML(fn, msg) then begin
|
||||||
|
MapView.GetMapProviders(CbProviders.Items);
|
||||||
|
CbProviders.ItemIndex := 0;
|
||||||
|
MapView.MapProvider := CbProviders.Text;
|
||||||
|
end else
|
||||||
|
ShowMessage(msg);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.BtnSaveMapProvidersClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MapView.Engine.WriteProvidersToXML(Application.Location + MAP_PROVIDER_FILENAME);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.BtnSearchClick(Sender: TObject);
|
procedure TMainForm.BtnSearchClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
// MapView.Center := GeoNames.Search(CbLocations.Text, MapView.DownloadEngine);
|
|
||||||
|
|
||||||
ClearFoundLocations;
|
ClearFoundLocations;
|
||||||
// GeoNames.LocationName := CbLocations.Text;
|
|
||||||
GeoNames.Search(CbLocations.Text, MapView.DownloadEngine);
|
GeoNames.Search(CbLocations.Text, MapView.DownloadEngine);
|
||||||
// GeoNames.ListLocations(MapView.DownloadEngine);
|
|
||||||
//CbFoundLocations.Text := CbFoundLocations.Items[0];
|
|
||||||
UpdateDropdownWidth(CbFoundLocations);
|
UpdateDropdownWidth(CbFoundLocations);
|
||||||
UpdateLocationHistory(CbLocations.Text);
|
UpdateLocationHistory(CbLocations.Text);
|
||||||
if CbFoundLocations.Items.Count > 0 then CbFoundLocations.ItemIndex := 0;
|
if CbFoundLocations.Items.Count > 0 then CbFoundLocations.ItemIndex := 0;
|
||||||
@ -276,7 +297,7 @@ begin
|
|||||||
txt := APoint.Name;
|
txt := APoint.Name;
|
||||||
bmp := TBitmap.Create;
|
bmp := TBitmap.Create;
|
||||||
try
|
try
|
||||||
// bmp.PixelFormat := pf32Bit;
|
// bmp.PixelFormat := pf32Bit; // crashes Linux!
|
||||||
w := bmp.Canvas.TextWidth(txt);
|
w := bmp.Canvas.TextWidth(txt);
|
||||||
h := bmp.Canvas.TextHeight(txt);
|
h := bmp.Canvas.TextHeight(txt);
|
||||||
bmp.SetSize(w, h);
|
bmp.SetSize(w, h);
|
||||||
|
@ -106,13 +106,6 @@ Type
|
|||||||
procedure TileDownloaded(Data: PtrInt);
|
procedure TileDownloaded(Data: PtrInt);
|
||||||
Procedure RegisterProviders;
|
Procedure RegisterProviders;
|
||||||
Procedure DrawTile(const TileId: TTileId; X,Y: integer; TileImg: TLazIntfImage);
|
Procedure DrawTile(const TileId: TTileId; X,Y: integer; TileImg: TLazIntfImage);
|
||||||
|
|
||||||
function GetLetterSvr(id: integer): String;
|
|
||||||
function GetYahooSvr(id: integer): String;
|
|
||||||
function GetYahooY(const Tile: TTileId): string;
|
|
||||||
function GetYahooZ(const Tile: TTileId): string;
|
|
||||||
function GetQuadKey(const Tile: TTileId): string;
|
|
||||||
|
|
||||||
Procedure DoDrag(Sender: TDragObj);
|
Procedure DoDrag(Sender: TDragObj);
|
||||||
public
|
public
|
||||||
constructor Create(aOwner: TComponent); override;
|
constructor Create(aOwner: TComponent); override;
|
||||||
@ -123,13 +116,16 @@ Type
|
|||||||
GetXStr: TGetValStr = nil; GetYStr: TGetValStr = nil;
|
GetXStr: TGetValStr = nil; GetYStr: TGetValStr = nil;
|
||||||
GetZStr: TGetValStr = nil): TMapProvider;
|
GetZStr: TGetValStr = nil): TMapProvider;
|
||||||
procedure CancelCurrentDrawing;
|
procedure CancelCurrentDrawing;
|
||||||
|
procedure ClearMapProviders;
|
||||||
procedure GetMapProviders(AList: TStrings);
|
procedure GetMapProviders(AList: TStrings);
|
||||||
function LonLatToScreen(aPt: TRealPoint): TPoint;
|
function LonLatToScreen(aPt: TRealPoint): TPoint;
|
||||||
function LonLatToWorldScreen(aPt: TRealPoint): TPoint;
|
function LonLatToWorldScreen(aPt: TRealPoint): TPoint;
|
||||||
|
function ReadProvidersFromXML(AFileName: String; out AMsg: String): Boolean;
|
||||||
procedure Redraw;
|
procedure Redraw;
|
||||||
function ScreenToLonLat(aPt: TPoint): TRealPoint;
|
function ScreenToLonLat(aPt: TPoint): TRealPoint;
|
||||||
procedure SetSize(aWidth, aHeight: integer);
|
procedure SetSize(aWidth, aHeight: integer);
|
||||||
function WorldScreenToLonLat(aPt: TPoint): TRealPoint;
|
function WorldScreenToLonLat(aPt: TPoint): TRealPoint;
|
||||||
|
procedure WriteProvidersToXML(AFileName: String);
|
||||||
|
|
||||||
procedure DblClick(Sender: TObject);
|
procedure DblClick(Sender: TObject);
|
||||||
procedure MouseDown(Sender: TObject; Button: TMouseButton;
|
procedure MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
@ -169,7 +165,7 @@ Type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Math, Forms,
|
Math, Forms, laz2_xmlread, laz2_xmlwrite, laz2_dom,
|
||||||
mvJobs, mvGpsObj;
|
mvJobs, mvGpsObj;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -328,12 +324,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TMapViewerEngine.Destroy;
|
destructor TMapViewerEngine.Destroy;
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
begin
|
begin
|
||||||
|
ClearMapProviders;
|
||||||
FreeAndNil(DragObj);
|
FreeAndNil(DragObj);
|
||||||
for i:=0 to lstProvider.Count-1 do
|
|
||||||
TObject(lstProvider.Objects[i]).Free;
|
|
||||||
FreeAndNil(lstProvider);
|
FreeAndNil(lstProvider);
|
||||||
FreeAndNil(Cache);
|
FreeAndNil(Cache);
|
||||||
FreeAndNil(Queue);
|
FreeAndNil(Queue);
|
||||||
@ -397,6 +390,15 @@ begin
|
|||||||
Queue.WaitForTerminate(Jobs);
|
Queue.WaitForTerminate(Jobs);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMapViewerEngine.ClearMapProviders;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
for i:=0 to lstProvider.Count-1 do
|
||||||
|
TObject(lstProvider.Objects[i]).Free;
|
||||||
|
lstProvider.Clear;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMapViewerEngine.ConstraintZoom(var aWin: TMapWindow);
|
procedure TMapViewerEngine.ConstraintZoom(var aWin: TMapWindow);
|
||||||
var
|
var
|
||||||
zMin, zMax: integer;
|
zMin, zMax: integer;
|
||||||
@ -505,37 +507,11 @@ begin
|
|||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMapViewerEngine.GetLetterSvr(id: integer): String;
|
|
||||||
begin
|
|
||||||
Result := Char(Ord('a') + id);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMapViewerEngine.GetMapProviders(AList: TStrings);
|
procedure TMapViewerEngine.GetMapProviders(AList: TStrings);
|
||||||
begin
|
begin
|
||||||
AList.Assign(lstProvider);
|
AList.Assign(lstProvider);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMapViewerEngine.GetQuadKey(const Tile : TTileId): string;
|
|
||||||
var
|
|
||||||
i, d, m: Longword;
|
|
||||||
begin
|
|
||||||
{
|
|
||||||
Bing Maps Tile System
|
|
||||||
http://msdn.microsoft.com/en-us/library/bb259689.aspx
|
|
||||||
}
|
|
||||||
Result := '';
|
|
||||||
for i := Tile.Z downto 1 do
|
|
||||||
begin
|
|
||||||
d := 0;
|
|
||||||
m := 1 shl (i - 1);
|
|
||||||
if (Tile.x and m) <> 0 then
|
|
||||||
Inc(d, 1);
|
|
||||||
if (Tile.y and m) <> 0 then
|
|
||||||
Inc(d, 2);
|
|
||||||
Result := Result + IntToStr(d);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMapViewerEngine.GetTileName(const Id: TTileId): String;
|
function TMapViewerEngine.GetTileName(const Id: TTileId): String;
|
||||||
begin
|
begin
|
||||||
Result := IntToStr(Id.X) + '.' + IntToStr(Id.Y) + '.' + IntToStr(Id.Z);
|
Result := IntToStr(Id.X) + '.' + IntToStr(Id.Y) + '.' + IntToStr(Id.Z);
|
||||||
@ -551,21 +527,6 @@ begin
|
|||||||
Result := MapWin.Width;
|
Result := MapWin.Width;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMapViewerEngine.GetYahooSvr(id: integer): String;
|
|
||||||
Begin
|
|
||||||
Result := IntToStr(id + 1);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMapViewerEngine.GetYahooY(const Tile : TTileId): string;
|
|
||||||
begin
|
|
||||||
Result := IntToStr( -(Tile.Y - (1 shl Tile.Z) div 2) - 1);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMapViewerEngine.GetYahooZ(const Tile : TTileId): string;
|
|
||||||
Begin
|
|
||||||
result := IntToStr(Tile.Z + 1);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMapViewerEngine.GetZoom: integer;
|
function TMapViewerEngine.GetZoom: integer;
|
||||||
begin
|
begin
|
||||||
Result := MapWin.Zoom;
|
Result := MapWin.Zoom;
|
||||||
@ -727,6 +688,114 @@ Begin
|
|||||||
SetCenter(nCenter);
|
SetCenter(nCenter);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMapViewerEngine.ReadProvidersFromXML(AFileName: String;
|
||||||
|
out AMsg: String): Boolean;
|
||||||
|
|
||||||
|
function GetSvrStr(AName: String): TGetSvrStr;
|
||||||
|
var
|
||||||
|
lcName: String;
|
||||||
|
begin
|
||||||
|
lcName := LowerCase(AName);
|
||||||
|
case lcName of
|
||||||
|
'letter': Result := @GetLetterSvr;
|
||||||
|
'yahoo': Result := @GetYahooSvr;
|
||||||
|
else Result := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetValStr(AName: String): TGetValStr;
|
||||||
|
var
|
||||||
|
lcName: String;
|
||||||
|
begin
|
||||||
|
lcName := Lowercase(AName);
|
||||||
|
case lcName of
|
||||||
|
'quadkey': Result := @GetQuadKey;
|
||||||
|
'yahooy': Result := @GetYahooY;
|
||||||
|
'yahooz': Result := @GetYahooZ;
|
||||||
|
else Result := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetAttrValue(ANode: TDOMNode; AttrName: String): String;
|
||||||
|
var
|
||||||
|
node: TDOMNode;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
if ANode.HasAttributes then begin
|
||||||
|
node := ANode.Attributes.GetNamedItem(AttrName);
|
||||||
|
if Assigned(node) then Result := node.NodeValue;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
stream: TFileStream;
|
||||||
|
doc: TXMLDocument = nil;
|
||||||
|
node, layerNode: TDOMNode;
|
||||||
|
attr: TDOMNamedNodeMap;
|
||||||
|
providerName: String;
|
||||||
|
url: String;
|
||||||
|
minZoom: Integer;
|
||||||
|
maxZoom: Integer;
|
||||||
|
svrCount: Integer;
|
||||||
|
s: String;
|
||||||
|
svrProc: String;
|
||||||
|
xProc: String;
|
||||||
|
yProc: String;
|
||||||
|
zProc: String;
|
||||||
|
first: Boolean;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
AMsg := '';
|
||||||
|
stream := TFileStream.Create(AFileName, fmOpenread or fmShareDenyWrite);
|
||||||
|
try
|
||||||
|
ReadXMLFile(doc, stream, [xrfAllowSpecialCharsInAttributeValue, xrfAllowLowerThanInAttributeValue]);
|
||||||
|
node := doc.FindNode('map_providers');
|
||||||
|
if node = nil then begin
|
||||||
|
AMsg := 'No map providers in file.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
first := true;
|
||||||
|
node := node.FirstChild;
|
||||||
|
while node <> nil do begin
|
||||||
|
providerName := GetAttrValue(node, 'name');
|
||||||
|
layerNode := node.FirstChild;
|
||||||
|
while layerNode <> nil do begin
|
||||||
|
url := GetAttrValue(layerNode, 'url');
|
||||||
|
if url = '' then
|
||||||
|
continue;
|
||||||
|
s := GetAttrValue(layerNode, 'minZom');
|
||||||
|
if s = '' then minZoom := 0
|
||||||
|
else minZoom := StrToInt(s);
|
||||||
|
s := GetAttrValue(layerNode, 'maxZoom');
|
||||||
|
if s = '' then maxzoom := 9
|
||||||
|
else maxZoom := StrToInt(s);
|
||||||
|
s := GetAttrValue(layerNode, 'serverCount');
|
||||||
|
if s = '' then svrCount := 1
|
||||||
|
else svrCount := StrToInt(s);
|
||||||
|
svrProc := GetAttrValue(layerNode, 'serverProc');
|
||||||
|
xProc := GetAttrValue(layerNode, 'xProc');
|
||||||
|
yProc := GetAttrValue(layerNode, 'yProc');
|
||||||
|
zProc := GetAttrValue(layerNode, 'zProc');
|
||||||
|
layerNode := layerNode.NextSibling;
|
||||||
|
end;
|
||||||
|
if first then begin
|
||||||
|
ClearMapProviders;
|
||||||
|
first := false;
|
||||||
|
end;
|
||||||
|
AddMapProvider(providerName,
|
||||||
|
url, minZoom, maxZoom, svrCount,
|
||||||
|
GetSvrStr(svrProc), GetValStr(xProc), GetValStr(yProc), GetValStr(zProc)
|
||||||
|
);
|
||||||
|
node := node.NextSibling;
|
||||||
|
end;
|
||||||
|
Result := true;
|
||||||
|
finally
|
||||||
|
stream.Free;
|
||||||
|
doc.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMapViewerEngine.Redraw;
|
procedure TMapViewerEngine.Redraw;
|
||||||
begin
|
begin
|
||||||
Redraw(MapWin);
|
Redraw(MapWin);
|
||||||
@ -970,6 +1039,27 @@ begin
|
|||||||
Result := ScreenToLonLat(aPt);
|
Result := ScreenToLonLat(aPt);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMapViewerEngine.WriteProvidersToXML(AFileName: String);
|
||||||
|
var
|
||||||
|
doc: TXMLDocument;
|
||||||
|
root: TDOMNode;
|
||||||
|
i: Integer;
|
||||||
|
prov: TMapProvider;
|
||||||
|
begin
|
||||||
|
doc := TXMLDocument.Create;
|
||||||
|
try
|
||||||
|
root := doc.CreateElement('map_providers');
|
||||||
|
doc.AppendChild(root);
|
||||||
|
for i := 0 to lstProvider.Count - 1 do begin
|
||||||
|
prov := TMapProvider(lstProvider.Objects[i]);
|
||||||
|
prov.ToXML(doc, root);
|
||||||
|
end;
|
||||||
|
WriteXMLFile(doc, AFileName);
|
||||||
|
finally
|
||||||
|
doc.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMapViewerEngine.ZoomOnArea(const aArea: TRealArea);
|
procedure TMapViewerEngine.ZoomOnArea(const aArea: TRealArea);
|
||||||
var
|
var
|
||||||
tmpWin: TMapWindow;
|
tmpWin: TMapWindow;
|
||||||
|
@ -22,22 +22,23 @@ unit mvMapProvider;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils;
|
Classes, SysUtils, laz2_xmlwrite, laz2_dom;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TTileId }
|
{ TTileId }
|
||||||
|
|
||||||
TTileId = record
|
TTileId = record
|
||||||
X, Y: int64;
|
X, Y: int64;
|
||||||
Z: integer;
|
Z: integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TGetSvrStr = function (id: integer): string;
|
||||||
TGetSvrStr = function (id: integer): string of object;
|
TGetValStr = function (const Tile: TTileId): String;
|
||||||
TGetValStr = function (const Tile: TTileId): String of object;
|
|
||||||
|
|
||||||
{ TMapProvider }
|
{ TMapProvider }
|
||||||
|
|
||||||
TMapProvider = Class
|
TMapProvider = class
|
||||||
private
|
private
|
||||||
FLayer: integer;
|
FLayer: integer;
|
||||||
idServer: Array of Integer;
|
idServer: Array of Integer;
|
||||||
@ -60,15 +61,63 @@ type
|
|||||||
GetSvrStr: TGetSvrStr; GetXStr: TGetValStr; GetYStr: TGetValStr;
|
GetSvrStr: TGetSvrStr; GetXStr: TGetValStr; GetYStr: TGetValStr;
|
||||||
GetZStr: TGetValStr);
|
GetZStr: TGetValStr);
|
||||||
procedure GetZoomInfos(out AZoomMin, AZoomMax: integer);
|
procedure GetZoomInfos(out AZoomMin, AZoomMax: integer);
|
||||||
Function GetUrlForTile(id: TTileId): String;
|
function GetUrlForTile(id: TTileId): String;
|
||||||
|
procedure ToXML(ADoc: TXMLDocument; AParentNode: TDOMNode);
|
||||||
property Name: String read FName;
|
property Name: String read FName;
|
||||||
property LayerCount: integer read GetLayerCount;
|
property LayerCount: integer read GetLayerCount;
|
||||||
property Layer: integer read FLayer write SetLayer;
|
property Layer: integer read FLayer write SetLayer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function GetLetterSvr(id: integer): String;
|
||||||
|
function GetYahooSvr(id: integer): String;
|
||||||
|
function GetYahooY(const Tile: TTileId): string;
|
||||||
|
function GetYahooZ(const Tile: TTileId): string;
|
||||||
|
function GetQuadKey(const Tile: TTileId): string;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
function GetLetterSvr(id: integer): String;
|
||||||
|
begin
|
||||||
|
Result := Char(Ord('a') + id);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetQuadKey(const Tile: TTileId): string;
|
||||||
|
var
|
||||||
|
i, d, m: Longword;
|
||||||
|
begin
|
||||||
|
{ Bing Maps Tile System
|
||||||
|
http://msdn.microsoft.com/en-us/library/bb259689.aspx }
|
||||||
|
Result := '';
|
||||||
|
for i := Tile.Z downto 1 do
|
||||||
|
begin
|
||||||
|
d := 0;
|
||||||
|
m := 1 shl (i - 1);
|
||||||
|
if (Tile.x and m) <> 0 then
|
||||||
|
Inc(d, 1);
|
||||||
|
if (Tile.y and m) <> 0 then
|
||||||
|
Inc(d, 2);
|
||||||
|
Result := Result + IntToStr(d);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetYahooSvr(id: integer): String;
|
||||||
|
Begin
|
||||||
|
Result := IntToStr(id + 1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetYahooY(const Tile : TTileId): string;
|
||||||
|
begin
|
||||||
|
Result := IntToStr( -(Tile.Y - (1 shl Tile.Z) div 2) - 1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetYahooZ(const Tile : TTileId): string;
|
||||||
|
Begin
|
||||||
|
result := IntToStr(Tile.Z + 1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TMapProvider }
|
{ TMapProvider }
|
||||||
|
|
||||||
function TMapProvider.getLayerCount: integer;
|
function TMapProvider.getLayerCount: integer;
|
||||||
@ -172,5 +221,48 @@ begin
|
|||||||
Result := StringReplace(Result, '%z%', ZVal, [rfreplaceall]);
|
Result := StringReplace(Result, '%z%', ZVal, [rfreplaceall]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMapProvider.ToXML(ADoc: TXMLDocument; AParentNode: TDOMNode);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
node: TDOMElement;
|
||||||
|
layerNode: TDOMElement;
|
||||||
|
s: String;
|
||||||
|
begin
|
||||||
|
node := ADoc.CreateElement('map_provider');
|
||||||
|
node.SetAttribute('name', FName);
|
||||||
|
AParentNode.AppendChild(node);
|
||||||
|
for i:=0 to LayerCount-1 do begin
|
||||||
|
layerNode := ADoc.CreateElement('layer');
|
||||||
|
node.AppendChild(layernode);
|
||||||
|
layerNode.SetAttribute('url', FUrl[i]);
|
||||||
|
layerNode.SetAttribute('minZoom', IntToStr(FMinZoom[i]));
|
||||||
|
layerNode.SetAttribute('maxZoom', IntToStr(FMaxZoom[i]));
|
||||||
|
layerNode.SetAttribute('serverCount', IntToStr(FNbSvr[i]));
|
||||||
|
|
||||||
|
if FGetSvrStr[i] = @getLetterSvr then s := 'Letter'
|
||||||
|
else if FGetSvrStr[i] = @GetYahooSvr then s := 'Yahoo'
|
||||||
|
else if FGetSvrstr[i] <> nil then s := 'unknown'
|
||||||
|
else s := '';
|
||||||
|
if s <> '' then layerNode.SetAttribute('serverProc', s);
|
||||||
|
|
||||||
|
if FGetXStr[i] = @GetQuadKey then s := 'QuadKey'
|
||||||
|
else if FGetXStr[i] <> nil then s := '(unknown)'
|
||||||
|
else s := '';
|
||||||
|
if s <> '' then layerNode.SetAttribute('xProc', s);
|
||||||
|
|
||||||
|
if FGetYStr[i] = @GetQuadKey then s := 'QuadKey'
|
||||||
|
else if FGetYStr[i] = @GetYahooY then s := 'YahooY'
|
||||||
|
else if FGetYStr[i] <> nil then s := '(unknown)'
|
||||||
|
else s := '';
|
||||||
|
if s <> '' then layerNode.SetAttribute('yProc', s);
|
||||||
|
|
||||||
|
if FGetZStr[i] = @GetQuadKey then s := 'QuadKey'
|
||||||
|
else if FGetZStr[i] = @GetYahooZ then s := 'YahooZ'
|
||||||
|
else if FGetZStr[i] <> nil then s := '(unknown)'
|
||||||
|
else s := '';
|
||||||
|
if s <> '' then layerNode.SetAttribute('zProc', s);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user