Lazarus

Programming => Packages and Libraries => Topic started by: seany on November 12, 2019, 05:35:50 pm

Title: Map Viewer for Lazarus 2.0.4
Post by: seany 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
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp 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.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: seany 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
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp 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.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: Fr0sT-Brutal on November 21, 2019, 02:31:06 pm
Hi, I had no issues installing OSMMap onto Lazarus trunk ...
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 07, 2020, 02:00:49 pm
Hi,

This is of interest to me, I tried TMapviewer before and had limited success.  So if there has been some revision to this then that's good to know.

However, following the install info above, I tried to compile and get the message:-

"Cannot find LazarusPackageIntf used by lazMapViewerPkg. Check if package FCL is in the dependencies of package lazMapViewerPkg."

How can I fix this?

Thanks.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 07, 2020, 02:48:52 pm
I've read about this error several times, but have never seen it myself. What is your Lazarus version, FPC version, bitness (32-bit or 64 bit), operating system, widgetset?

Since a third-party component must be compiled and linked into the IDE my first reaction when having similar compilation issues is to do a clean rebuild of the IDE ("Tools" > "Configure Build Lazarus" > in the "Clean up" box check "Clean all" and "Switch after building to automatically" > "Build").
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 10, 2020, 08:52:27 am
Thanks for the support.

Version is 1.6.4, FPC 3.0.2, SVN Revision 54278, x86_64-win64-win32/win64.  Don't know about widgetset.

I am probably quite out of date but I have not updated to a newer version because some of my programs employ a unit that does not work on later versions and it would affect a few of my programs.  I think I have a solution for that so should really make the changes and move up to the latest version.

Thanks.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 10, 2020, 09:46:32 am
I just tried to install LazMapViewer on Laz 1.6.4/FPC3.0.2 (32 bit) on Win10 - no problem at all. And also the MapViewer demo compiles and runs fine with this version.

Compilation issues related to very elemental units often are an indication that you should perform a clean rebuild of the IDE: Go to "Tools" > "Configure 'Build Lazarus'" > in the "Cleanup" box check "Clean all" and "Switch after building to automatically" > "Build"

Yes, your version 1.6.4 is really outdated. In particular when you use third-party components you will sooner or later run into issues. You should address the issues with that unit as soon as possible. Did you know that you can install additional versions of Lazarus without affecting your current installation? In the second screen of the installer, check the box "Create a secondary installation", and in the next screen, "Select configuration folder", define a directory for the config files, e.g. c:\laz_cfg\<version> (the default config folder is c:\users\<your name>\appdata\local\lazarus -- do not use it because it is would interfere with your primary installation). A few screens later, do not confirm to register any file types to this installation. When you now perform the installation your primary Lazarus version will be left untouched, and you can use both. But be aware that loading an old project into a new Lazarus version can write new properties to the lfm file which cause trouble if you want to open the project again in your old version. So: always make a copy of your project before you open it into the secondary installation.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 10, 2020, 03:09:55 pm
Thanks for the support.

I followed the cleanup instructions and tried again to install TMapviewer.  Same problem.

As it happens I have another laptop which has never had Lazarus installed on it.  So I installed the latest version of Lazarus for Windows 64 bit.  I got a fresh download of the files from your link mentioned in previous posts and tried to install the package.  Same problem.

So I don't know what is wrong but I am sure it is operator error on my part.....
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 10, 2020, 03:29:34 pm
I got a fresh download of the files from your link mentioned in previous posts and tried to install the package.
Which link exactly? I have so many posts so that it is impossible for me to tell which the "previous post" is.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 10, 2020, 04:07:42 pm
Post of November 12, 2019, 06:02:29 pm in this thread which includes:-


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.

Any help greatly appreciated...
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 10, 2020, 04:45:34 pm
Yes, correct. I have no idea what is going wrong...
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: avra on August 10, 2020, 06:20:41 pm
Translation : can't find httpsend - but Synapse 40.1 is installed. It seems that Synapse 40.1 does not make httpsend available any more.
I can install MapViewer in FPC 3.2.1 and Lazarus 2.0.11. If I search for 'httpsend' in my OPM Synapse directory I can see that it can be found in these files:
Quote
laz_synapse.lpk
httpsend.o
httpsend.pas
laz_synapse.pas
mimemess.pas
mimepart.pas
lib\httpsend.ppu
lib\laz_synapse.ppu
Can you check if you have the same results?
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 10, 2020, 06:52:04 pm
The basic LazMapViewer package (lazmapviewerpkg.lpk) works even without Synapse. Try to install this package only to get rid of other dependencies.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 11, 2020, 04:29:24 pm
I had a fresh install on a new laptop and tried mapviewer before Synapse, that's when I had the error and on another laptop where Synapse (I think) was already installed, same error.

Most strange.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 11, 2020, 04:56:32 pm
Can you install any other third-party components?
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: avra on August 11, 2020, 09:36:21 pm
Most strange.
Even stranger is that you ask for help and you ignore helping instructions. That cuts me out of this thread.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 12, 2020, 10:08:43 am
avra, I don't know how you think I ignored helping instructions, if you read through I am following where appropriate.  Your last post regarding Synapse - I had not installed it and as per another post this should not be required to at least install the mapviewer.  Thanks for your support.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 12, 2020, 10:14:01 am
wp - I have not had the need for any other third party components so haven't tried.  This is the only one that has been of interest to me.  I did manage an install of mapviewer some time ago, maybe 2 years or so back, and it was fine.  I actually have another older laptop never had lazarus on it.  So I installed on that one, followed the instructions, same result.  Could there be a problem with the files I downloaded from sourceforge.net?
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 12, 2020, 10:47:20 am
No idea...

Go to the laptop on which you installed the current Lazarus release. Load lazmapviewerpkg.lpk and press Compile in the package editor dialog - does the compilation of the package complete successfully? If yes, proceed and click "Use" > "Install". DECLINE the question to rebuild Lazarus. Close the package editor. Go to "Tools" > "Configure "Build Lazarus"". In the "Clean up" box check "Clean all" and "Switch after building to automatically". Click "Build" - it should work and complete the recompilation of the IDE including MapViewer, I did it many, many times. If it does not you must rename the file "Lazarus.old.exe" to "Lazarus.exe" (in your Lazarus installation) in order to restore the Lazarus version before attempting to install MapViewer.

A good candidate to explain abnormal behavior is the AntiVirus system installed. Always put the Lazarus and your project folders on the white-list of the virus scanner. Antivirus companies often detect FPC and its tools as malware because they are not widely used. You may also try to turn off AV during recompilation of the IDE, the process I described above.  Get rid of any commercial scanner, and stick to the built-in scanner coming with Win 10; it has the least interference with Laz/FPC and is sufficiently good for protection (some tests even say it's better than the commericals, but I don't trust tests...).
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 12, 2020, 11:34:48 am
Thanks for your help with this.

I have started afresh and start lazarus with new project.  opened the lazmapviewerpkg.lpk and it wont compile, just the same message that "LazarusPackageIntf" cannot be found.

Just for information, when I go to download the files from sourceforge.net, the only option I see to download all files is the "download snapshot" facility.  If I look at the file lazmapviewerpkg.pas in my downloaded files and compare directly to the same file on the site, they are different.
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: wp on August 12, 2020, 05:24:58 pm
Now that I know how you get the package, we're getting closer...

Download the snapshot from https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/lazmapviewer/ and try again. Now the package files are stored in the old package format - several months ago the format of the package xml files was changed; old Lazarus versions cannot read these files correctly. There is a "maximize compatibility" flag in the package options which stores the files in the old format to make them usable also in non-trunk versions. This flag was not set...
Title: Re: Map Viewer for Lazarus 2.0.4
Post by: ranny on August 14, 2020, 09:16:37 am
That's it!  Worked perfectly, no issues installing and it looks like all is well.

Thank you very much for helping me with this, very much appreciated.  Using the demo I tried opening a GPX file and it crashed but suspect the file format has issues which I can investigate.

Again, many thanks.   
TinyPortal © 2005-2018