Recent

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

seany

  • Full Member
  • ***
  • Posts: 120
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
My projects, among others:

https://linktr.ee/siderealNight

wp

  • Hero Member
  • *****
  • Posts: 11830
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.

seany

  • Full Member
  • ***
  • Posts: 120
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
My projects, among others:

https://linktr.ee/siderealNight

wp

  • Hero Member
  • *****
  • Posts: 11830
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.

Fr0sT-Brutal

  • Newbie
  • Posts: 2
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 ...

ranny

  • Jr. Member
  • **
  • Posts: 64
Re: Map Viewer for Lazarus 2.0.4
« Reply #5 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.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Map Viewer for Lazarus 2.0.4
« Reply #6 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").

ranny

  • Jr. Member
  • **
  • Posts: 64
Re: Map Viewer for Lazarus 2.0.4
« Reply #7 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.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Map Viewer for Lazarus 2.0.4
« Reply #8 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.

ranny

  • Jr. Member
  • **
  • Posts: 64
Re: Map Viewer for Lazarus 2.0.4
« Reply #9 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.....

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Map Viewer for Lazarus 2.0.4
« Reply #10 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.

ranny

  • Jr. Member
  • **
  • Posts: 64
Re: Map Viewer for Lazarus 2.0.4
« Reply #11 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...

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Map Viewer for Lazarus 2.0.4
« Reply #12 on: August 10, 2020, 04:45:34 pm »
Yes, correct. I have no idea what is going wrong...

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Map Viewer for Lazarus 2.0.4
« Reply #13 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?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Map Viewer for Lazarus 2.0.4
« Reply #14 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.

 

TinyPortal © 2005-2018