Recent

Author Topic: Map Viewer for Lazarus 2.0.4  (Read 301 times)

seany

  • New Member
  • *
  • Posts: 14
Map Viewer for Lazarus 2.0.4
« on: November 12, 2019, 05:35:50 pm »
Hi

I am using Lazarus 2.0.4 FPC 3.0.4 on Arch linux qt5.

I am trying to use a mapview widget to display google or OSM maps on my application.

However, I am failing to do so as follows:

Option 1 : TMapviewer:
I have downloaded the zip file here: https://codeload.github.com/odisey1245/mapviewer/zip/master

I have then extracted it, went to Packages > Open package file (*.lpk) > then navigate to the extracted folder.

After loading the package with double clicking, i click on the  compile button on the newly opened dialog box , It fails with :
Code: Pascal  [Select]
  1. kcMapViewerDESynapse.pas(26,35) Fatal: Kann httpsend nicht finden verwendet von kcMapViewerDESynapse.

Translation : can't find httpsend - but Synapse 40.1 is installed. It seems that Synapse 40.1 does not make httpsend available any more.

Then I tried option 2:
I downloaded https://codeload.github.com/Fr0sT-Brutal/Delphi_OSMMap/zip/master

I compiled this successfully. I then clickede on Use > Install. Which also seemed to work well - but then when asked to recompile Lazarus IDE, i am left with this error message:

Code: [Select]

Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/hedgehog/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
Looking for code tools config file:  "/home/hedgehog/.lazarus/codetoolsoptions.xml"
Hinweis: CodeTools-Konfigurationsdatei nicht gefunden - verwende Voreinstellungen
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-qt5 New=x86_64-linux-qt5 Changed: OS/CPU=True LCL=False
NOTE: help options config file not found - using defaults
----------------
InitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner
Hint: closing unneeded package "kcMapViewerPckg"
Hint: (lazarus) compile package OSMMapLaz 0.0 Flags=[]
Hint: (lazarus) Missing state file of ImagesForLazarus 1.0.1: /usr/lib/lazarus/components/images/lib/x86_64-linux/qt5/ImagesForLazarus.compiled
Error: (lazarus) unable to create package output directory "/usr/lib/lazarus/components/images/lib/x86_64-linux/qt5" of package "ImagesForLazarus 1.0.1"
Hint: (lazarus) normal output directory of package ImagesForLazarus 1.0.1 is not writable: "/usr/lib/lazarus/components/images/lib/x86_64-linux/qt5/"
Hint: (lazarus) Fallback output directory of ImagesForLazarus: /home/hedgehog/.lazarus/lib/ImagesForLazarus/lib/x86_64-linux/qt5
TParsedCompilerOptions.SetOutputDirectoryOverride New=/home/hedgehog/.lazarus/lib/ImagesForLazarus/lib/x86_64-linux/qt5
Info: (lazarus) Execute Title="Kompiliere Package OSMMapLaz 0.0"
Info: (lazarus) Working Directory="/home/hedgehog/Work/AI_Base/GUI/Delphi_OSMMap-master/Packages/"
Info: (lazarus) Executable="/usr/bin/fpc"
Info: (lazarus) Param[0]="-MObjFPC"
Info: (lazarus) Param[1]="-Scghi"
Info: (lazarus) Param[2]="-CX"
Info: (lazarus) Param[3]="-Cg"
Info: (lazarus) Param[4]="-O1"
Info: (lazarus) Param[5]="-g"
Info: (lazarus) Param[6]="-gl"
Info: (lazarus) Param[7]="-l"
Info: (lazarus) Param[8]="-vewnhibq"
Info: (lazarus) Param[9]="-Fu/home/hedgehog/Work/AI_Base/GUI/Delphi_OSMMap-master/Source"
Info: (lazarus) Param[10]="-Fu/usr/lib/lazarus/packager/units/x86_64-linux"
Info: (lazarus) Param[11]="-Fu/usr/lib/lazarus/components/lazutils/lib/x86_64-linux"
Info: (lazarus) Param[12]="-Fu/usr/lib/lazarus/lcl/units/x86_64-linux"
Info: (lazarus) Param[13]="-Fu/usr/lib/lazarus/lcl/units/x86_64-linux/qt5"
Info: (lazarus) Param[14]="-Fu/home/hedgehog/.lazarus/lib/ImagesForLazarus/lib/x86_64-linux/qt5"
Info: (lazarus) Param[15]="-Fu/home/hedgehog/Work/AI_Base/GUI/Delphi_OSMMap-master/Packages/"
Info: (lazarus) Param[16]="-FU/home/hedgehog/Work/AI_Base/GUI/Delphi_OSMMap-master/Lib/x86_64-linux/"
Info: (lazarus) Param[17]="-dLCL"
Info: (lazarus) Param[18]="-dLCLqt5"
Info: (lazarus) Param[19]="OSMMapLaz.pas"
Hint: (lazarus) [CalcTargets] Lazarus directory is readonly, using fallback target directory: /home/hedgehog/.lazarus/bin
Hint: (lazarus) [CalcTargets] Lazarus directory is readonly, using fallback target directory: /home/hedgehog/.lazarus/bin
Note: (lazarus) deleted backup "/home/hedgehog/.lazarus/bin/lazarus.old"
Note: (lazarus) renamed file "/home/hedgehog/.lazarus/bin/lazarus" to "/home/hedgehog/.lazarus/bin/lazarus.old"
Hint: (lazarus) [CalcTargets] Lazarus directory is readonly, using fallback target directory: /home/hedgehog/.lazarus/bin
Info: (lazarus) Execute Title="IDE erstellen"
Info: (lazarus) Working Directory="/usr/lib/lazarus/"
Info: (lazarus) Executable="/usr/bin/make"
Info: (lazarus) Param[0]="-w"
Info: (lazarus) Param[1]="idepkg"
Hint: (lazarus) TMainIDE.DoRestart
 is a file
Hint: (lazarus) CmdLine=[/usr/lib/lazarus/startlazarus --lazarus-pid=14584 --primary-config-path=/home/hedgehog/.lazarus]
LAZARUS END - cleaning up ...
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END
Speicherzugriffsfehler (Speicherabzug geschrieben)





Speicherzugriffsfehler (Speicherabzug geschrieben) = > Segmentation Fault. Core dumped.

After this Lazarus restarts, but the component isn't available in the palette .

I have installed Lazarus-qt5 version from official arch repo.

So I do not know of any other map viewing element . Please help

wp

  • Hero Member
  • *****
  • Posts: 6491
Re: Map Viewer for Lazarus 2.0.4
« Reply #1 on: November 12, 2019, 06:02:29 pm »
Option 1 : TMapviewer:
I have downloaded the zip file here: https://codeload.github.com/odisey1245/mapviewer/zip/master

I have then extracted it, went to Packages > Open package file (*.lpk) > then navigate to the extracted folder.

After loading the package with double clicking, i click on the  compile button on the newly opened dialog box , It fails with :
Code: Pascal  [Select]
  1. kcMapViewerDESynapse.pas(26,35) Fatal: Kann httpsend nicht finden verwendet von kcMapViewerDESynapse.

Translation : can't find httpsend - but Synapse 40.1 is installed. It seems that Synapse 40.1 does not make httpsend available any more.
The problem with github is that everybody can clone a repository and there are numerous unmaintained repos around out there... The version you are using is a clone of the original version of Maciej Kaczkowski. In the meantime, numerous improvements have been added, and a lot of bugs have been fixed.

I think the only repository which is currently maintained is the one on Lazarus Code and Component Repository (CCR): https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/lazmapviewer/. Download the files from here using svn (or download the "snapshot" - but this includes all the other ccr files, you can delete everything except for the folder components/lazmapviewer). Then, in Lazarus, go to "Package" > "Open package file" and navigate to the folder with the mapviewer files, open lazmapviewerpkg.lpk, click "Compile" and then "Use" > "Install". This will recompile the IDE and add the basic mapviewer components to the palette (page "Misc"). You can install also the other packages - they contain additions like Synapse-Downloader or BGRABitmap drawing engine; but you can also skip them, the basic functionality in lazmapviewerpkg is enough.

When the IDE is restarted you can load the demo project in folder example and run it. NOTE, however, that in contrast to what I said above, the additional packages for the BGRABitmap and FastRGBGraphics drawers are needed here; you must install them (ideally using the online package manager) before installing these MapViewer additions.

If you can't get the demo up and running I can create a stripped-down version of the demo which uses only the basic package.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

seany

  • New Member
  • *
  • Posts: 14
Re: Map Viewer for Lazarus 2.0.4
« Reply #2 on: November 12, 2019, 06:46:24 pm »
Hi
Thank you

RGBGraphics failed with :

Code: [Select]
TIDEFPCParser.ImproveMsgUnitNotFound FindUnitInAllUsesSections failed due to syntax errors or Qt5Objects is not used in /home/user/.lazarus/onlinepackagemanager/packages/RGBGraphics/source/rgbqt5routines.pas

not sure what to do

wp

  • Hero Member
  • *****
  • Posts: 6491
Re: Map Viewer for Lazarus 2.0.4
« Reply #3 on: November 12, 2019, 07:56:42 pm »
Did not test with qt5.

I modified the examples, there are two folders now, an "example_with_addons" in addition to the old "example". The project in the "example" folder now does not require addiitonal packages any more, only lazMapviewerPkg. Note that screen output is a bit slower than with RGBGraphics or BGRABitmap, there may be some occasional drawing artefacts due to the tiled painting when you quickly pan the viewport. If you don't scroll or zoom the default drawing engine is fine. Note also that the first view into an area always is a bit slow because the map images have to be downloaded from the map site. Afterwards, the already used images are stored in a cache folder ("example_cache"), and access is much faster.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Fr0sT-Brutal

  • Newbie
  • Posts: 1
Re: Map Viewer for Lazarus 2.0.4
« Reply #4 on: November 21, 2019, 02:31:06 pm »
Hi, I had no issues installing OSMMap onto Lazarus trunk ...