From 0418e4b8d434de81c03d37330e46a3c1f000cc58 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 18 May 2019 17:10:33 +0000 Subject: [PATCH] LazMapViewer: Initial version of a LCL drawing engine. Still buggy. Extend demo project to allow selection of drawing engines. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6924 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/lazmapviewer/example/main.lfm | 1363 +++++++++-------- components/lazmapviewer/example/main.pas | 37 +- components/lazmapviewer/lazmapviewerpkg.lpk | 14 +- components/lazmapviewer/lazmapviewerpkg.pas | 4 +- .../lazmapviewer/source/mvmapviewer.pas | 123 +- 5 files changed, 777 insertions(+), 764 deletions(-) diff --git a/components/lazmapviewer/example/main.lfm b/components/lazmapviewer/example/main.lfm index f24d7a351..fbc7d88b6 100644 --- a/components/lazmapviewer/example/main.lfm +++ b/components/lazmapviewer/example/main.lfm @@ -11,647 +11,20 @@ object MainForm: TMainForm OnShow = FormShow ShowHint = True LCLVersion = '2.1.0.0' - object ControlPanel: TPanel - Left = 606 - Height = 640 - Top = 0 - Width = 277 - Align = alRight - ClientHeight = 640 - ClientWidth = 277 - TabOrder = 1 - object CbProviders: TComboBox - AnchorSideLeft.Control = LblProviders - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = ControlPanel - AnchorSideRight.Control = BtnLoadMapProviders - Left = 69 - Height = 23 - Top = 9 - Width = 145 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 4 - DropDownCount = 24 - ItemHeight = 15 - OnChange = CbProvidersChange - Style = csDropDownList - TabOrder = 0 - end - object LblProviders: TLabel - AnchorSideLeft.Control = ControlPanel - AnchorSideTop.Control = CbProviders - AnchorSideTop.Side = asrCenter - Left = 9 - Height = 15 - Top = 13 - Width = 52 - BorderSpacing.Left = 8 - Caption = 'Providers:' - FocusControl = CbProviders - ParentColor = False - end - object CbUseThreads: TCheckBox - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = CbDoubleBuffer - Left = 9 - Height = 19 - Top = 40 - Width = 62 - Caption = 'Threads' - Checked = True - OnChange = CbUseThreadsChange - State = cbChecked - TabOrder = 1 - end - object CbDoubleBuffer: TCheckBox - AnchorSideLeft.Control = CbUseThreads - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = CbProviders - AnchorSideTop.Side = asrBottom - Left = 87 - Height = 19 - Top = 40 - Width = 87 - BorderSpacing.Left = 16 - BorderSpacing.Top = 8 - BorderSpacing.Right = 9 - Caption = 'DblBuffering' - Checked = True - OnChange = CbDoubleBufferChange - State = cbChecked - TabOrder = 2 - end - object ZoomTrackBar: TTrackBar - AnchorSideLeft.Control = CbProviders - AnchorSideTop.Control = CbDoubleBuffer - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = ControlPanel - AnchorSideRight.Side = asrBottom - Left = 69 - Height = 40 - Top = 59 - Width = 207 - Max = 19 - Min = 1 - OnChange = ZoomTrackBarChange - Position = 1 - TickMarks = tmBoth - Anchors = [akTop, akLeft, akRight] - TabOrder = 3 - end - object LblZoom: TLabel - AnchorSideLeft.Control = ControlPanel - AnchorSideTop.Control = ZoomTrackBar - AnchorSideTop.Side = asrCenter - Left = 9 - Height = 15 - Top = 72 - Width = 35 - BorderSpacing.Left = 8 - Caption = 'Zoom:' - ParentColor = False - end - object CbMouseCoords: TGroupBox - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = ZoomTrackBar - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = BtnSaveMapProviders - AnchorSideRight.Side = asrBottom - Left = 9 - Height = 66 - Top = 107 - Width = 259 - Anchors = [akTop, akLeft, akRight] - AutoSize = True - BorderSpacing.Top = 8 - Caption = 'Mouse position' - ClientHeight = 46 - ClientWidth = 255 - TabOrder = 4 - object LblPositionLongitude: TLabel - AnchorSideLeft.Control = CbMouseCoords - AnchorSideTop.Control = CbMouseCoords - Left = 16 - Height = 15 - Top = 4 - Width = 54 - BorderSpacing.Left = 16 - BorderSpacing.Top = 4 - Caption = 'Longitude' - ParentColor = False - end - object LblPositionLatitude: TLabel - AnchorSideLeft.Control = CbMouseCoords - AnchorSideTop.Control = LblPositionLongitude - AnchorSideTop.Side = asrBottom - Left = 16 - Height = 15 - Top = 23 - Width = 43 - BorderSpacing.Left = 16 - BorderSpacing.Top = 4 - BorderSpacing.Bottom = 8 - Caption = 'Latitude' - ParentColor = False - end - object InfoPositionLongitude: TLabel - AnchorSideLeft.Control = CbMouseCoords - AnchorSideTop.Control = CbMouseCoords - AnchorSideRight.Control = CbMouseCoords - AnchorSideRight.Side = asrBottom - Left = 205 - Height = 15 - Top = 4 - Width = 34 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 4 - BorderSpacing.Right = 16 - Caption = 'Label2' - ParentColor = False - end - object InfoPositionLatitude: TLabel - AnchorSideLeft.Control = CbMouseCoords - AnchorSideTop.Control = InfoPositionLongitude - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = CbMouseCoords - AnchorSideRight.Side = asrBottom - Left = 205 - Height = 15 - Top = 23 - Width = 34 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 4 - BorderSpacing.Right = 16 - BorderSpacing.Bottom = 8 - Caption = 'Label2' - ParentColor = False - end - end - object GbCenterCoords: TGroupBox - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = CbMouseCoords - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = CbMouseCoords - AnchorSideRight.Side = asrBottom - Left = 9 - Height = 66 - Top = 181 - Width = 259 - Anchors = [akTop, akLeft, akRight] - AutoSize = True - BorderSpacing.Top = 8 - Caption = 'Center' - ClientHeight = 46 - ClientWidth = 255 - TabOrder = 5 - object LblCenterLongitude: TLabel - AnchorSideLeft.Control = GbCenterCoords - AnchorSideTop.Control = GbCenterCoords - Left = 16 - Height = 15 - Top = 4 - Width = 54 - BorderSpacing.Left = 16 - BorderSpacing.Top = 4 - Caption = 'Longitude' - ParentColor = False - end - object LblCenterLatitude: TLabel - AnchorSideLeft.Control = GbCenterCoords - AnchorSideTop.Control = LblCenterLongitude - AnchorSideTop.Side = asrBottom - Left = 16 - Height = 15 - Top = 23 - Width = 43 - BorderSpacing.Left = 16 - BorderSpacing.Top = 4 - BorderSpacing.Bottom = 8 - Caption = 'Latitude' - ParentColor = False - end - object InfoCenterLongitude: TLabel - AnchorSideLeft.Control = GbCenterCoords - AnchorSideTop.Control = GbCenterCoords - AnchorSideRight.Control = GbCenterCoords - AnchorSideRight.Side = asrBottom - Left = 205 - Height = 15 - Top = 4 - Width = 34 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 4 - BorderSpacing.Right = 16 - Caption = 'Label2' - ParentColor = False - end - object InfoCenterLatitude: TLabel - AnchorSideLeft.Control = GbCenterCoords - AnchorSideTop.Control = InfoCenterLongitude - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = GbCenterCoords - AnchorSideRight.Side = asrBottom - Left = 205 - Height = 15 - Top = 23 - Width = 34 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 4 - BorderSpacing.Right = 16 - BorderSpacing.Bottom = 8 - Caption = 'Label2' - ParentColor = False - end - end - object CbLocations: TComboBox - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = BtnSearch - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = BtnSearch - Left = 9 - Height = 23 - Top = 334 - Width = 190 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 4 - DropDownCount = 24 - ItemHeight = 15 - TabOrder = 6 - Text = 'New York' - end - object BtnSearch: TButton - AnchorSideTop.Control = GbScreenSize - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = GbCenterCoords - AnchorSideRight.Side = asrBottom - Left = 207 - Height = 25 - Top = 333 - Width = 61 - Anchors = [akTop, akRight] - AutoSize = True - BorderSpacing.Top = 12 - Caption = 'Search' - OnClick = BtnSearchClick - TabOrder = 7 - end - object CbFoundLocations: TComboBox - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = Label8 - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = BtnGoTo - Left = 9 - Height = 21 - Top = 388 - Width = 196 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 4 - BorderSpacing.Right = 8 - DropDownCount = 24 - ItemHeight = 15 - ItemWidth = -2 - OnDrawItem = CbFoundLocationsDrawItem - ParentShowHint = False - ShowHint = True - Style = csOwnerDrawFixed - TabOrder = 8 - end - object Label8: TLabel - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = CbLocations - AnchorSideTop.Side = asrBottom - Left = 9 - Height = 15 - Top = 369 - Width = 177 - BorderSpacing.Top = 12 - Caption = 'Select one of the found locations:' - ParentColor = False - end - object BtnGoTo: TButton - AnchorSideTop.Control = CbFoundLocations - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = BtnSearch - AnchorSideRight.Side = asrBottom - Left = 213 - Height = 25 - Top = 386 - Width = 55 - Anchors = [akTop, akRight] - AutoSize = True - Caption = 'Go to' - OnClick = BtnGoToClick - TabOrder = 9 - end - object InfoBtnGPSPoints: TLabel - AnchorSideLeft.Control = BtnGPSPoints - AnchorSideTop.Control = BtnGPSPoints - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = BtnGoTo - AnchorSideRight.Side = asrBottom - Left = 9 - Height = 52 - Top = 483 - Width = 259 - Anchors = [akTop, akLeft, akRight] - AutoSize = False - BorderSpacing.Top = 8 - Caption = 'Click with right mouse button to add a GPS point.' - ParentColor = False - WordWrap = True - end - object BtnGPSPoints: TButton - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = BtnSaveToFile - AnchorSideTop.Side = asrBottom - Left = 9 - Height = 25 - Top = 450 - Width = 92 - AutoSize = True - BorderSpacing.Top = 8 - Caption = 'GPS points...' - OnClick = BtnGPSPointsClick - TabOrder = 10 - end - object GPSPointInfo: TLabel - AnchorSideLeft.Control = InfoBtnGPSPoints - AnchorSideTop.Control = InfoBtnGPSPoints - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = InfoBtnGPSPoints - AnchorSideRight.Side = asrBottom - Left = 9 - Height = 64 - Top = 535 - Width = 259 - Anchors = [akTop, akLeft, akRight] - AutoSize = False - Caption = 'GPSPointInfo' - ParentColor = False - WordWrap = True - 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 - object BtnSaveToFile: TButton - AnchorSideLeft.Control = LblProviders - AnchorSideTop.Control = CbFoundLocations - AnchorSideTop.Side = asrBottom - Left = 9 - Height = 25 - Top = 417 - Width = 110 - AutoSize = True - BorderSpacing.Top = 8 - Caption = 'Save map to file' - OnClick = BtnSaveToFileClick - TabOrder = 11 - end - object GbScreenSize: TGroupBox - AnchorSideLeft.Control = GbCenterCoords - AnchorSideTop.Control = GbCenterCoords - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = GbCenterCoords - AnchorSideRight.Side = asrBottom - Left = 9 - Height = 66 - Top = 255 - Width = 259 - Anchors = [akTop, akLeft, akRight] - AutoSize = True - BorderSpacing.Top = 8 - Caption = 'Viewport size' - ClientHeight = 46 - ClientWidth = 255 - TabOrder = 12 - object LblViewportWidth: TLabel - AnchorSideLeft.Control = GbScreenSize - AnchorSideTop.Control = GbScreenSize - Left = 16 - Height = 15 - Top = 4 - Width = 32 - BorderSpacing.Left = 16 - BorderSpacing.Top = 4 - Caption = 'Width' - ParentColor = False - end - object LblViewportHeight: TLabel - AnchorSideLeft.Control = GbScreenSize - AnchorSideTop.Control = LblViewportWidth - AnchorSideTop.Side = asrBottom - Left = 16 - Height = 15 - Top = 23 - Width = 36 - BorderSpacing.Left = 16 - BorderSpacing.Top = 4 - BorderSpacing.Bottom = 8 - Caption = 'Height' - ParentColor = False - end - object InfoViewportWidth: TLabel - AnchorSideTop.Control = GbScreenSize - AnchorSideRight.Control = GbScreenSize - AnchorSideRight.Side = asrBottom - Left = 205 - Height = 15 - Top = 4 - Width = 34 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 4 - BorderSpacing.Right = 16 - Caption = 'Label2' - ParentColor = False - end - object InfoViewportHeight: TLabel - AnchorSideTop.Control = InfoViewportWidth - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = GbScreenSize - AnchorSideRight.Side = asrBottom - Left = 205 - Height = 15 - Top = 23 - Width = 34 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 4 - BorderSpacing.Right = 16 - BorderSpacing.Bottom = 8 - Caption = 'Label2' - ParentColor = False - end - end - object CbDistanceUnits: TComboBox - AnchorSideTop.Control = GbCenterCoords - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = GbCenterCoords - AnchorSideRight.Side = asrBottom - Left = 176 - Height = 23 - Top = 253 - Width = 76 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 6 - BorderSpacing.Right = 16 - ItemHeight = 15 - ItemIndex = 1 - Items.Strings = ( - 'm' - 'km' - 'miles' - ) - OnChange = CbDistanceUnitsChange - Style = csDropDownList - TabOrder = 13 - Text = 'km' - end - object BtnLoadGPXFile: TButton - AnchorSideLeft.Control = BtnSaveToFile - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = BtnSaveToFile - Left = 127 - Height = 25 - Top = 417 - Width = 105 - AutoSize = True - BorderSpacing.Left = 8 - Caption = 'Load GPX file...' - OnClick = BtnLoadGPXFileClick - TabOrder = 14 - end - object CbDebugTiles: TCheckBox - AnchorSideLeft.Control = CbDoubleBuffer - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = CbDoubleBuffer - Left = 190 - Height = 19 - Top = 40 - Width = 55 - BorderSpacing.Left = 16 - Caption = 'Debug' - OnChange = CbDebugTilesChange - TabOrder = 15 - end - end object MapView: TMapView Left = 0 Height = 640 Hint = 'Displays the map' Top = 0 - Width = 606 + Width = 608 Active = False Align = alClient CacheOnDisk = True CachePath = 'cache/' DefaultTrackColor = clBlue DefaultTrackWidth = 3 - DownloadEngine = MapView.BuiltIn + DownloadEngine = MapView.BuiltInDLE + DrawingEngine = MapView.BuiltInDE InactiveColor = clWhite MapProvider = 'OpenStreetMap Mapnik' UseThreads = True @@ -663,15 +36,737 @@ object MainForm: TMainForm OnMouseMove = MapViewMouseMove OnMouseUp = MapViewMouseUp end + object PageControl: TPageControl + Left = 608 + Height = 640 + Top = 0 + Width = 275 + ActivePage = PgData + Align = alRight + TabIndex = 0 + TabOrder = 1 + object PgData: TTabSheet + Caption = 'Data' + ClientHeight = 612 + ClientWidth = 267 + object ZoomTrackBar: TTrackBar + AnchorSideLeft.Control = PgData + AnchorSideTop.Control = LblZoom + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = PgData + AnchorSideRight.Side = asrBottom + Left = 2 + Height = 40 + Top = 21 + Width = 263 + Max = 19 + Min = 1 + OnChange = ZoomTrackBarChange + Position = 1 + TickMarks = tmBoth + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 2 + BorderSpacing.Right = 2 + TabOrder = 0 + end + object LblZoom: TLabel + AnchorSideLeft.Control = PgData + AnchorSideTop.Control = PgData + Left = 6 + Height = 15 + Top = 6 + Width = 35 + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + Caption = 'Zoom:' + ParentColor = False + end + object CbMouseCoords: TGroupBox + AnchorSideLeft.Control = PgData + AnchorSideTop.Control = ZoomTrackBar + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = PgData + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 66 + Top = 69 + Width = 255 + Anchors = [akTop, akLeft, akRight] + AutoSize = True + BorderSpacing.Left = 6 + BorderSpacing.Top = 8 + BorderSpacing.Right = 6 + Caption = 'Mouse position' + ClientHeight = 46 + ClientWidth = 251 + TabOrder = 1 + object LblPositionLongitude: TLabel + AnchorSideLeft.Control = CbMouseCoords + AnchorSideTop.Control = CbMouseCoords + Left = 8 + Height = 15 + Top = 4 + Width = 54 + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + Caption = 'Longitude' + ParentColor = False + end + object LblPositionLatitude: TLabel + AnchorSideLeft.Control = CbMouseCoords + AnchorSideTop.Control = LblPositionLongitude + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 15 + Top = 23 + Width = 43 + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + BorderSpacing.Bottom = 8 + Caption = 'Latitude' + ParentColor = False + end + object InfoPositionLongitude: TLabel + AnchorSideLeft.Control = CbMouseCoords + AnchorSideTop.Control = CbMouseCoords + AnchorSideRight.Control = CbMouseCoords + AnchorSideRight.Side = asrBottom + Left = 201 + Height = 15 + Top = 4 + Width = 34 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 4 + BorderSpacing.Right = 16 + Caption = 'Label2' + ParentColor = False + end + object InfoPositionLatitude: TLabel + AnchorSideLeft.Control = CbMouseCoords + AnchorSideTop.Control = InfoPositionLongitude + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = CbMouseCoords + AnchorSideRight.Side = asrBottom + Left = 201 + Height = 15 + Top = 23 + Width = 34 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 4 + BorderSpacing.Right = 16 + BorderSpacing.Bottom = 8 + Caption = 'Label2' + ParentColor = False + end + end + object GbCenterCoords: TGroupBox + AnchorSideLeft.Control = LblZoom + AnchorSideTop.Control = CbMouseCoords + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = CbMouseCoords + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 66 + Top = 143 + Width = 255 + Anchors = [akTop, akLeft, akRight] + AutoSize = True + BorderSpacing.Top = 8 + Caption = 'Center' + ClientHeight = 46 + ClientWidth = 251 + TabOrder = 2 + object LblCenterLongitude: TLabel + AnchorSideLeft.Control = GbCenterCoords + AnchorSideTop.Control = GbCenterCoords + Left = 8 + Height = 15 + Top = 4 + Width = 54 + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + Caption = 'Longitude' + ParentColor = False + end + object LblCenterLatitude: TLabel + AnchorSideLeft.Control = GbCenterCoords + AnchorSideTop.Control = LblCenterLongitude + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 15 + Top = 23 + Width = 43 + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + BorderSpacing.Bottom = 8 + Caption = 'Latitude' + ParentColor = False + end + object InfoCenterLongitude: TLabel + AnchorSideLeft.Control = GbCenterCoords + AnchorSideTop.Control = GbCenterCoords + AnchorSideRight.Control = GbCenterCoords + AnchorSideRight.Side = asrBottom + Left = 201 + Height = 15 + Top = 4 + Width = 34 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 4 + BorderSpacing.Right = 16 + Caption = 'Label2' + ParentColor = False + end + object InfoCenterLatitude: TLabel + AnchorSideLeft.Control = GbCenterCoords + AnchorSideTop.Control = InfoCenterLongitude + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GbCenterCoords + AnchorSideRight.Side = asrBottom + Left = 201 + Height = 15 + Top = 23 + Width = 34 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 4 + BorderSpacing.Right = 16 + BorderSpacing.Bottom = 8 + Caption = 'Label2' + ParentColor = False + end + end + object GbScreenSize: TGroupBox + AnchorSideLeft.Control = GbCenterCoords + AnchorSideTop.Control = GbCenterCoords + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GbCenterCoords + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 66 + Top = 217 + Width = 255 + Anchors = [akTop, akLeft, akRight] + AutoSize = True + BorderSpacing.Top = 8 + Caption = 'Viewport size' + ClientHeight = 46 + ClientWidth = 251 + TabOrder = 3 + object LblViewportWidth: TLabel + AnchorSideLeft.Control = GbScreenSize + AnchorSideTop.Control = GbScreenSize + Left = 8 + Height = 15 + Top = 4 + Width = 32 + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + Caption = 'Width' + ParentColor = False + end + object LblViewportHeight: TLabel + AnchorSideLeft.Control = GbScreenSize + AnchorSideTop.Control = LblViewportWidth + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 15 + Top = 23 + Width = 36 + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + BorderSpacing.Bottom = 8 + Caption = 'Height' + ParentColor = False + end + object InfoViewportWidth: TLabel + AnchorSideTop.Control = GbScreenSize + AnchorSideRight.Control = GbScreenSize + AnchorSideRight.Side = asrBottom + Left = 201 + Height = 15 + Top = 4 + Width = 34 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 4 + BorderSpacing.Right = 16 + Caption = 'Label2' + ParentColor = False + end + object InfoViewportHeight: TLabel + AnchorSideTop.Control = InfoViewportWidth + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GbScreenSize + AnchorSideRight.Side = asrBottom + Left = 201 + Height = 15 + Top = 23 + Width = 34 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 4 + BorderSpacing.Right = 16 + BorderSpacing.Bottom = 8 + Caption = 'Label2' + ParentColor = False + end + end + object CbDistanceUnits: TComboBox + AnchorSideTop.Control = GbCenterCoords + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GbCenterCoords + AnchorSideRight.Side = asrBottom + Left = 189 + Height = 23 + Top = 215 + Width = 64 + Anchors = [akTop, akRight] + BorderSpacing.Top = 6 + BorderSpacing.Right = 8 + ItemHeight = 15 + ItemIndex = 1 + Items.Strings = ( + 'm' + 'km' + 'miles' + ) + OnChange = CbDistanceUnitsChange + Style = csDropDownList + TabOrder = 4 + Text = 'km' + end + object GbSearch: TGroupBox + AnchorSideLeft.Control = GbScreenSize + AnchorSideTop.Control = GbScreenSize + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GbScreenSize + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 105 + Top = 291 + Width = 255 + Anchors = [akTop, akLeft, akRight] + AutoSize = True + BorderSpacing.Top = 8 + Caption = 'Search' + ClientHeight = 85 + ClientWidth = 251 + TabOrder = 5 + object CbLocations: TComboBox + AnchorSideLeft.Control = GbSearch + AnchorSideTop.Control = GbSearch + AnchorSideRight.Control = BtnSearch + Left = 8 + Height = 23 + Top = 4 + Width = 172 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + BorderSpacing.Right = 4 + BorderSpacing.Bottom = 4 + DropDownCount = 24 + ItemHeight = 15 + TabOrder = 0 + Text = 'New York' + end + object BtnSearch: TButton + AnchorSideTop.Control = CbLocations + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = GbSearch + AnchorSideRight.Side = asrBottom + Left = 184 + Height = 25 + Top = 3 + Width = 61 + Anchors = [akTop, akRight] + AutoSize = True + BorderSpacing.Right = 6 + Caption = 'Search' + OnClick = BtnSearchClick + TabOrder = 1 + end + object LblSelectLocation: TLabel + AnchorSideLeft.Control = CbLocations + AnchorSideTop.Control = CbLocations + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 15 + Top = 35 + Width = 177 + BorderSpacing.Top = 8 + Caption = 'Select one of the found locations:' + ParentColor = False + end + object BtnGoTo: TButton + AnchorSideTop.Control = CbFoundLocations + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = BtnSearch + AnchorSideRight.Side = asrBottom + Left = 190 + Height = 25 + Top = 52 + Width = 55 + Anchors = [akTop, akRight] + AutoSize = True + BorderSpacing.Bottom = 8 + Caption = 'Go to' + OnClick = BtnGoToClick + TabOrder = 2 + end + object CbFoundLocations: TComboBox + AnchorSideLeft.Control = LblSelectLocation + AnchorSideTop.Control = LblSelectLocation + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = BtnGoTo + Left = 8 + Height = 21 + Top = 54 + Width = 178 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 4 + BorderSpacing.Right = 4 + BorderSpacing.Bottom = 8 + DropDownCount = 24 + ItemHeight = 15 + ItemWidth = -2 + OnDrawItem = CbFoundLocationsDrawItem + ParentShowHint = False + ShowHint = True + Style = csOwnerDrawFixed + TabOrder = 3 + end + end + object GbGPS: TGroupBox + AnchorSideLeft.Control = GbSearch + AnchorSideTop.Control = GbSearch + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GbSearch + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 105 + Top = 404 + Width = 255 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 8 + Caption = 'GPS points' + ClientHeight = 85 + ClientWidth = 251 + TabOrder = 6 + object BtnGPSPoints: TButton + AnchorSideLeft.Control = GbGPS + AnchorSideTop.Control = GbGPS + AnchorSideRight.Control = GbGPS + AnchorSideRight.Side = asrBottom + Left = 192 + Height = 25 + Top = 0 + Width = 53 + Anchors = [akTop, akRight] + AutoSize = True + BorderSpacing.Left = 6 + BorderSpacing.Right = 6 + Caption = 'List...' + OnClick = BtnGPSPointsClick + TabOrder = 0 + end + object InfoBtnGPSPoints: TLabel + AnchorSideLeft.Control = GbGPS + AnchorSideTop.Control = BtnGPSPoints + AnchorSideRight.Control = BtnGPSPoints + Left = 8 + Height = 30 + Top = 4 + Width = 178 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 8 + BorderSpacing.Top = 4 + Caption = 'Click with right mouse button to add a GPS point.' + ParentColor = False + WordWrap = True + end + object GPSPointInfo: TLabel + AnchorSideLeft.Control = InfoBtnGPSPoints + AnchorSideTop.Control = InfoBtnGPSPoints + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GbGPS + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = GbGPS + AnchorSideBottom.Side = asrBottom + Left = 8 + Height = 35 + Top = 50 + Width = 237 + Anchors = [akTop, akLeft, akRight, akBottom] + AutoSize = False + BorderSpacing.Top = 16 + BorderSpacing.Right = 6 + Caption = 'GPSPointInfo' + ParentColor = False + WordWrap = True + end + end + object BtnSaveToFile: TButton + AnchorSideLeft.Control = GbGPS + AnchorSideTop.Control = GbGPS + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 25 + Top = 517 + Width = 110 + AutoSize = True + BorderSpacing.Top = 8 + Caption = 'Save map to file' + OnClick = BtnSaveToFileClick + TabOrder = 7 + end + object BtnLoadGPXFile: TButton + AnchorSideLeft.Control = BtnSaveToFile + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = BtnSaveToFile + Left = 124 + Height = 25 + Top = 517 + Width = 105 + AutoSize = True + BorderSpacing.Left = 8 + Caption = 'Load GPX file...' + OnClick = BtnLoadGPXFileClick + TabOrder = 8 + end + end + object PgConfig: TTabSheet + Caption = 'Config' + ClientHeight = 612 + ClientWidth = 267 + object Label1: TLabel + AnchorSideLeft.Control = CbDrawingEngine + AnchorSideTop.Control = PgConfig + Left = 6 + Height = 15 + Top = 6 + Width = 86 + BorderSpacing.Top = 6 + Caption = 'Drawing engine:' + ParentColor = False + end + object CbDrawingEngine: TComboBox + AnchorSideLeft.Control = PgConfig + AnchorSideTop.Control = Label1 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = PgConfig + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 23 + Top = 23 + Width = 255 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 6 + BorderSpacing.Top = 2 + BorderSpacing.Right = 6 + ItemHeight = 15 + ItemIndex = 0 + Items.Strings = ( + 'default' + 'LCL' + ) + OnChange = CbDrawingEngineChange + Style = csDropDownList + TabOrder = 0 + Text = 'default' + end + object LblProviders: TLabel + AnchorSideLeft.Control = CbProviders + AnchorSideTop.Control = CbDrawingEngine + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 15 + Top = 54 + Width = 52 + BorderSpacing.Top = 8 + Caption = 'Providers:' + FocusControl = CbProviders + ParentColor = False + end + object CbProviders: TComboBox + AnchorSideLeft.Control = PgConfig + AnchorSideTop.Control = LblProviders + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = BtnLoadMapProviders + Left = 6 + Height = 23 + Top = 71 + Width = 199 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 6 + BorderSpacing.Top = 2 + BorderSpacing.Right = 4 + DropDownCount = 24 + ItemHeight = 15 + OnChange = CbProvidersChange + Style = csDropDownList + TabOrder = 1 + end + object BtnLoadMapProviders: TSpeedButton + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = CbProviders + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = BtnSaveMapProviders + Left = 209 + Height = 22 + Top = 71 + 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 = PgConfig + AnchorSideRight.Side = asrBottom + Left = 236 + Height = 22 + Top = 71 + 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 + object CbUseThreads: TCheckBox + AnchorSideLeft.Control = PgConfig + AnchorSideTop.Control = CbProviders + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 19 + Top = 102 + Width = 81 + BorderSpacing.Left = 6 + BorderSpacing.Top = 8 + Caption = 'Use threads' + Checked = True + OnChange = CbUseThreadsChange + State = cbChecked + TabOrder = 2 + end + object CbDoubleBuffer: TCheckBox + AnchorSideLeft.Control = CbUseThreads + AnchorSideTop.Control = CbUseThreads + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 19 + Top = 127 + Width = 87 + BorderSpacing.Top = 6 + BorderSpacing.Right = 9 + Caption = 'DblBuffering' + Checked = True + OnChange = CbDoubleBufferChange + State = cbChecked + TabOrder = 3 + end + object CbDebugTiles: TCheckBox + AnchorSideLeft.Control = CbDoubleBuffer + AnchorSideTop.Control = CbDoubleBuffer + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 19 + Top = 152 + Width = 79 + BorderSpacing.Top = 6 + Caption = 'Debug tiles' + OnChange = CbDebugTilesChange + TabOrder = 4 + end + end + end object GeoNames: TMVGeoNames OnNameFound = GeoNamesNameFound - left = 328 - top = 224 + left = 240 + top = 192 end object OpenDialog: TOpenDialog DefaultExt = '.pgx' Filter = 'GPX files (*.gpx)|*.gpx|All files (*.*)|*.*' - left = 832 - top = 424 + left = 240 + top = 456 end end diff --git a/components/lazmapviewer/example/main.pas b/components/lazmapviewer/example/main.pas index f17719ab4..ab915748a 100644 --- a/components/lazmapviewer/example/main.pas +++ b/components/lazmapviewer/example/main.pas @@ -7,7 +7,7 @@ interface uses Classes, SysUtils, Types, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, ComCtrls, Buttons, - mvGeoNames, mvMapViewer, mvTypes, mvGpsObj, mvDrawingEngine; + mvGeoNames, mvMapViewer, mvTypes, mvGpsObj, mvDrawingEngine, mvDE_LCL; type @@ -27,15 +27,19 @@ type CbMouseCoords: TGroupBox; CbDistanceUnits: TComboBox; CbDebugTiles: TCheckBox; + CbDrawingEngine: TComboBox; GbCenterCoords: TGroupBox; GbScreenSize: TGroupBox; + GbSearch: TGroupBox; + GbGPS: TGroupBox; InfoCenterLatitude: TLabel; InfoViewportHeight: TLabel; InfoCenterLongitude: TLabel; InfoBtnGPSPoints: TLabel; GPSPointInfo: TLabel; InfoViewportWidth: TLabel; - Label8: TLabel; + Label1: TLabel; + LblSelectLocation: TLabel; LblCenterLatitude: TLabel; LblViewportHeight: TLabel; LblViewportWidth: TLabel; @@ -48,10 +52,12 @@ type LblZoom: TLabel; MapView: TMapView; GeoNames: TMVGeoNames; - ControlPanel: TPanel; BtnLoadMapProviders: TSpeedButton; BtnSaveMapProviders: TSpeedButton; OpenDialog: TOpenDialog; + PageControl: TPageControl; + PgData: TTabSheet; + PgConfig: TTabSheet; ZoomTrackBar: TTrackBar; procedure BtnGoToClick(Sender: TObject); procedure BtnLoadGPXFileClick(Sender: TObject); @@ -59,6 +65,7 @@ type procedure BtnGPSPointsClick(Sender: TObject); procedure BtnSaveToFileClick(Sender: TObject); procedure CbDebugTilesChange(Sender: TObject); + procedure CbDrawingEngineChange(Sender: TObject); procedure CbDoubleBufferChange(Sender: TObject); procedure CbFoundLocationsDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); @@ -84,6 +91,7 @@ type procedure ZoomTrackBarChange(Sender: TObject); private + FLCLDrawingEngine: TLCLDrawingEngine; procedure ClearFoundLocations; procedure UpdateCoords(X, Y: Integer); procedure UpdateDropdownWidth(ACombobox: TCombobox); @@ -105,7 +113,7 @@ implementation uses LCLType, IniFiles, Math, FPCanvas, FPImage, IntfGraphics, - mvEngine, mvExtraData, mvGPX, + mvEngine, mvGPX, globals, gpslistform; type @@ -226,6 +234,17 @@ begin MapView.DebugTiles := CbDebugTiles.Checked; end; +procedure TMainForm.CbDrawingEngineChange(Sender: TObject); +begin + case CbDrawingEngine.ItemIndex of + 0: MapView.DrawingEngine := nil; + 1: begin + if FLCLDrawingEngine = nil then FLCLDrawingEngine := TLCLDrawingEngine.Create(self); + MapView.DrawingEngine := FLCLDrawingEngine; + end; + end; +end; + procedure TMainForm.CbDoubleBufferChange(Sender: TObject); begin MapView.DoubleBuffered := CbDoubleBuffer.Checked; @@ -296,10 +315,17 @@ begin CbProviders.ItemIndex := CbProviders.Items.Indexof(MapView.MapProvider); MapView.DoubleBuffered := true; MapView.Zoom := 1; - ControlPanel.Caption := ''; CbUseThreads.Checked := MapView.UseThreads; CbDoubleBuffer.Checked := MapView.DoubleBuffered; + InfoPositionLongitude.Caption := ''; + InfoPositionLatitude.Caption := ''; + InfoCenterLongitude.Caption := ''; + InfoCenterLatitude.Caption := ''; + InfoViewportWidth.Caption := ''; + InfoViewportHeight.Caption := ''; + GPSPointInfo.caption := ''; + ReadFromIni; end; @@ -343,6 +369,7 @@ begin // Draw the GPS point as a circle ADrawer.BrushColor := clRed; + ADrawer.BrushStyle := bsSolid; ADrawer.Ellipse(P.X - R, P.Y - R, P.X + R, P.Y + R); // Draw the caption of the GPS point diff --git a/components/lazmapviewer/lazmapviewerpkg.lpk b/components/lazmapviewer/lazmapviewerpkg.lpk index 165680968..2d84db576 100644 --- a/components/lazmapviewer/lazmapviewerpkg.lpk +++ b/components/lazmapviewer/lazmapviewerpkg.lpk @@ -14,7 +14,7 @@ - + @@ -74,16 +74,20 @@ This is a fork of MapViewer by ti_dic (https://sourceforge.net/p/roadbook/code/c - + - + - - + + + + + + diff --git a/components/lazmapviewer/lazmapviewerpkg.pas b/components/lazmapviewer/lazmapviewerpkg.pas index c4e13c4f6..86f68dcfd 100644 --- a/components/lazmapviewer/lazmapviewerpkg.pas +++ b/components/lazmapviewer/lazmapviewerpkg.pas @@ -10,8 +10,8 @@ interface uses mvCache, mvDownloadEngine, mvDragObj, mvEngine, mvGeoNames, mvGpsObj, mvJobQueue, mvJobs, mvMapProvider, mvTypes, mvMapViewer, mvExtraData, - mvDLEFpc, mvMapViewerReg, mvGPX, mvDrawingEngine, mvDEIntfGraphics, - LazarusPackageIntf; + mvDLEFpc, mvMapViewerReg, mvGPX, mvDrawingEngine, mvDE_IntfGraphics, + mvDE_LCL, LazarusPackageIntf; implementation diff --git a/components/lazmapviewer/source/mvmapviewer.pas b/components/lazmapviewer/source/mvmapviewer.pas index 270e4133f..212d2c90a 100644 --- a/components/lazmapviewer/source/mvmapviewer.pas +++ b/components/lazmapviewer/source/mvmapviewer.pas @@ -20,21 +20,11 @@ unit mvMapViewer; {$MODE objfpc}{$H+} -(* -// Activate one of the following defines -{$DEFINE USE_LAZINTFIMAGE} -{.$DEFINE USE_RGBGRAPHICS} // NOTE: This needs package "rgb_graphics" in requirements -// Make sure that one of the USE_XXXX defines is active. Default is USE_LAZINTFIMAGE -{$IFNDEF USE_RGBGRAPHICS}{$IFNDEF USE_LAZINTFIMAGE}{$DEFINE USE_LAZINTFIMAGES}{$ENDIF}{$ENDIF} -{$IFDEF USE_RGBGRAPHICS}{$IFDEF USE_LAZINTFIMAGE}{$UNDEF USE_RGBGRAPHICS}{$ENDIF}{$ENDIF} - *) interface uses Classes, SysUtils, Controls, Graphics, IntfGraphics, -// {$IFDEF USE_RGBGRAPHICS}RGBGraphics,{$ENDIF} -// {$IFDEF USE_LAZINTFIMAGE}FPCanvas,{$ENDIF} MvTypes, MvGPSObj, MvEngine, MvMapProvider, MvDownloadEngine, MvDrawingEngine; Type @@ -104,12 +94,6 @@ Type protected AsyncInvalidate : boolean; procedure ActivateEngine; - (* - {$IFDEF USE_LAZINTFIMAGE} - procedure CreateLazIntfImageAndCanvas(out ABuffer: TLazIntfImage; - out ACanvas: TFPCustomCanvas; AWidth, AHeight: Integer); - {$ENDIF} - *) procedure DblClick; override; procedure DoDrawTile(const TileId: TTileId; X,Y: integer; TileImg: TLazIntfImage); procedure DoDrawTileInfo(const TileID: TTileID; X,Y: Integer); @@ -176,65 +160,7 @@ Type implementation uses - {$IFDEF USE_LAZINTFIMAGE} - Math, FPImgCanv, FPImage, LCLVersion, - {$ENDIF} - GraphType, mvJobQueue, mvExtraData, mvDLEFpc, mvDEIntfGraphics; - - (* -{$IFDEF USE_LAZINTFIMAGE} -// Workaround for http://mantis.freepascal.org/view.php?id=27144 -procedure CopyPixels(ASource, ADest: TLazIntfImage; - XDst: Integer = 0; YDst: Integer = 0; - AlphaMask: Boolean = False; AlphaTreshold: Word = 0); -var - SrcHasMask, DstHasMask: Boolean; - x, y, xStart, yStart, xStop, yStop: Integer; - c: TFPColor; - SrcRawImage, DestRawImage: TRawImage; -begin - ASource.GetRawImage(SrcRawImage); - ADest.GetRawImage(DestRawImage); - - if DestRawImage.Description.IsEqual(SrcRawImage.Description) and (XDst = 0) and (YDst = 0) then - begin - // same description -> copy - if DestRawImage.Data <> nil then - System.Move(SrcRawImage.Data^, DestRawImage.Data^, DestRawImage.DataSize); - if DestRawImage.Mask <> nil then - System.Move(SrcRawImage.Mask^, DestRawImage.Mask^, DestRawImage.MaskSize); - Exit; - end; - - // copy pixels - XStart := IfThen(XDst < 0, -XDst, 0); - YStart := IfThen(YDst < 0, -YDst, 0); - XStop := IfThen(ADest.Width - XDst < ASource.Width, ADest.Width - XDst, ASource.Width) - 1; - YStop := IfTHen(ADest.Height - YDst < ASource.Height, ADest.Height - YDst, ASource.Height) - 1; - - SrcHasMask := SrcRawImage.Description.MaskBitsPerPixel > 0; - DstHasMask := DestRawImage.Description.MaskBitsPerPixel > 0; - - if DstHasMask then begin - for y:= yStart to yStop do - for x:=xStart to xStop do - ADest.Masked[x+XDst,y+YDst] := SrcHasMask and ASource.Masked[x,y]; - end; - - for y:=yStart to yStop do - for x:=xStart to xStop do - begin - c := ASource.Colors[x,y]; - if not DstHasMask and SrcHasMask and (c.alpha = $FFFF) then // copy mask to alpha channel - if ASource.Masked[x,y] then - c.alpha := 0; - - ADest.Colors[x+XDst,y+YDst] := c; - if AlphaMask and (c.alpha < AlphaTreshold) then - ADest.Masked[x+XDst,y+YDst] := True; - end; -end; -{$ENDIF} *) + GraphType, mvJobQueue, mvExtraData, mvDLEFpc, mvDE_IntfGraphics; Type @@ -462,6 +388,7 @@ begin FBuiltinDrawingEngine.CreateBuffer(0, 0); FDrawingEngine.CreateBuffer(ClientWidth, ClientHeight); end; + Engine.Redraw; end; procedure TMapView.SetInactiveColor(AValue: TColor); @@ -822,6 +749,7 @@ begin end else begin DrawingEngine.BrushColor := clWhite; + DrawingEngine.BrushStyle := bsSolid; DrawingEngine.FillRect(X, Y, X + TILE_SIZE, Y + TILE_SIZE); (* {$IFDEF USE_RGBGRAPHICS} @@ -849,28 +777,6 @@ begin DrawingEngine.Line(X, Y, X + TILE_SIZE, Y); DrawingEngine.Line(X + TILE_SIZE, Y, X + TILE_SIZE, Y + TILE_SIZE); DrawingEngine.Line(X, Y + TILE_SIZE, X + TILE_SIZE, Y + TILE_SIZE); - (* - {$IFDEF USE_LCL} - Buffer.Canvas.Pen.Color := clGray; - Buffer.Canvas.Pen.Style := psSolid; - Buffer.Canvas.Line(X, Y, X, Y + TILE_SIZE); - Buffer.Canvas.Line(X, Y, X + TILE_SIZE, Y); - Buffer.Canvas.Line(X + TILE_SIZE, Y, X + TILE_SIZE, Y + TILE_SIZE); - Buffer.Canvas.Line(X + TILE_SIZE, Y + TILE_SIZE, X, Y + TILE_SIZE); - {$ENDIF} - - {$IFDEF USE_RGBGRAPHICS} - {$ENDIF} - - {$IFDEF USE_LAZINTFIMAGE} - BufferCanvas.Pen.FPColor := colGray; - BufferCanvas.Pen.Style := psSolid; - BufferCanvas.Line(X, Y, X, Y + TILE_SIZE); - BufferCanvas.Line(X, Y, X + TILE_SIZE, Y); - BufferCanvas.Line(X + TILE_SIZE, Y, X + TILE_SIZE, Y + TILE_SIZE); - BufferCanvas.Line(X, Y + TILE_SIZE, X + TILE_SIZE, Y + TILE_SIZE); - {$ENDIF} - *) end; function TMapView.IsActive: Boolean; @@ -889,7 +795,7 @@ begin FInactiveColor := clWhite; FEngine := TMapViewerEngine.Create(self); FBuiltinDownloadEngine := TMvDEFpc.Create(self); - FBuiltinDownLoadEngine.Name := 'BuiltIn'; + FBuiltinDownloadEngine.Name := 'BuiltInDLE'; FDefaultTrackColor := clRed; FDefaultTrackWidth := 1; (* @@ -909,6 +815,7 @@ begin Width := 150; Height := 150; FBuiltinDrawingEngine := TIntfGraphicsDrawingEngine.Create(self); + FBuiltinDrawingEngine.Name := 'BuiltInDE'; FbuiltinDrawingEngine.CreateBuffer(Width, Height); end; @@ -924,26 +831,6 @@ begin FreeAndNil(FGPSItems); inherited Destroy; end; - (* -{$IFDEF USE_LAZINTFIMAGE} -procedure TMapView.CreateLazIntfImageAndCanvas(out ABuffer: TLazIntfImage; - out ACanvas: TFPCustomCanvas; AWidth, AHeight: Integer); -var - rawImg: TRawImage; -begin - rawImg.Init; - {$IFDEF DARWIN} - rawImg.Description.Init_BPP32_A8R8G8B8_BIO_TTB(AWidth, AHeight); - {$ELSE} - rawImg.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth, AHeight); - {$ENDIF} - rawImg.CreateData(True); - ABuffer := TLazIntfImage.Create(rawImg, true); - ACanvas := TFPImageCanvas.Create(ABuffer); - ACanvas.Brush.FPColor := colWhite; - ACanvas.FillRect(0, 0, AWidth, AHeight); -end; -{$ENDIF} *) procedure TMapView.SaveToFile(AClass: TRasterImageClass; const AFileName: String); var