Recent

Author Topic: New version of LazMapViewer  (Read 2874 times)

wp

  • Hero Member
  • *****
  • Posts: 13622
New version of LazMapViewer
« on: April 11, 2025, 05:20:14 pm »
After a long time, a new version of LazMapViewer has been released for OPM.

Considerable progress has been made by contributions of forum user "alpine" who dramatically improved drawing performance and usability on non-Windows widgetsets. He also added a layer system so that multiple layers of (semitransparent) layers can be overlayed, and markers and tracks and areas can be added even at design-time (https://wiki.lazarus.freepascal.org/LazMapViewer#Map_Overlays).

Forum user "EkkehardDomning" added a plugin manager which makes it very easy to extend the functionality of the mapviewer by addons. Now we have addons for drawing a magnification scale, a degree grid, popup hints for markers, dragging markers, adding copyright notes, etc. All available plugins are listed on the updated wiki page https://wiki.lazarus.freepascal.org/LazMapViewer#Available_plugins. There is also a new wiki page covering the topic of how to write your own plugins (https://wiki.freepascal.org/LazMapViewer-Plugins).

fozkan

  • New member
  • *
  • Posts: 8
Re: New version of LazMapViewer
« Reply #1 on: April 14, 2025, 09:26:32 pm »
Thank you for your efforts.

Dzandaa

  • Hero Member
  • *****
  • Posts: 556
  • From C# to Lazarus
Re: New version of LazMapViewer
« Reply #2 on: April 20, 2025, 12:24:47 pm »
I tried to install LazMapviewer with a freshly installed Pascal Lazarus 4.8 on Windows 10 64-bit.
The different parts are downloaded, and the installation stops after the synapse part.
There is no recompilation of the IDE.

On the other hand I did the installations from the downloaded .lpk files and it seems to work.

I still have to test/adapt my old programs using LazMapviewer.

Thank you anyway.

B->
Regards,
Dzandaa

Dzandaa

  • Hero Member
  • *****
  • Posts: 556
  • From C# to Lazarus
Re: New version of LazMapViewer
« Reply #3 on: April 20, 2025, 12:32:20 pm »
Hi again,
I tested my program using LazMapviewer on Windows 10 64 Bits, Lazarus 4.8, and with a minor change, it's working.

Thank you again.

B->
Regards,
Dzandaa

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: New version of LazMapViewer
« Reply #4 on: April 20, 2025, 12:37:49 pm »
the installation stops after the synapse part. There is no recompilation of the IDE.
Did you install Synapse first? But anyway, the Synapse DownloadEngine normally is not needed, it is included only for users having Synapse in their project already. Otherwise, in Windows the internal windows routines are called, and in the other OSs the FPHttpClient is used.

I tested my program using LazMapviewer on Windows 10 64 Bits, Lazarus 4.8, and with a minor change, it's working.
What did you have to change? LazMapViewer should work out of the box.

Dzandaa

  • Hero Member
  • *****
  • Posts: 556
  • From C# to Lazarus
Re: New version of LazMapViewer
« Reply #5 on: April 20, 2025, 12:55:49 pm »
Hi,

Just the map provider OpenStreet Mapnick to OpenStreet Normal.

Also tested on Linux Mint 22.1, same problem for installation but using the downloaded .lpk, it's O.K.

Thank you again.

B->

Regards,
Dzandaa

folkeu08

  • Full Member
  • ***
  • Posts: 118
Re: New version of LazMapViewer
« Reply #6 on: December 16, 2025, 11:08:57 pm »
Hi WP,

Can you make an example for OpenStreetMap with TGPSArea = class(TGPSPolyLine).
Thanks

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: New version of LazMapViewer
« Reply #7 on: December 17, 2025, 12:26:03 am »
Just use the GPS track example from the wiki (https://wiki.lazarus.freepascal.org/LazMapViewer#Creating_a_custom_track) and replace "track" by "area". But here is a sample project, too.

folkeu08

  • Full Member
  • ***
  • Posts: 118
Re: New version of LazMapViewer
« Reply #8 on: December 18, 2025, 09:59:20 pm »
Hi wp,
In the last example, the provider used was 'OpenStreetMap Maplink', which I had replaced with 'OpenStreetMap Standard'.
Nothing was displayed.

Thank you. I'll be able to use transparent polygons now.

Hansvb

  • Hero Member
  • *****
  • Posts: 929
Re: New version of LazMapViewer
« Reply #9 on: June 12, 2026, 09:04:58 pm »
Hi,

Is it possible to zoom in further on a map in LazMapViewer? I would like to be able to zoom in a bit further on my own geometry but there is the ZoomMax:= 19 property. I am not allowed to enter a higher number.

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: New version of LazMapViewer
« Reply #10 on: June 12, 2026, 10:56:43 pm »
No. When you cannot zoom any further you've reached the limits of that map provider - there are no more images at finer detail. But there are differences in the highest magnification from provider to provider. While OpenStreetMap goes only up to zoom 19, GoogleMaps oder Satellite go up to 21, likewise Yandex Detailed.

Look at file mvengine_mapreg.inc to see all the providers supported directly, the min and max zoom levels are parameters directly after the URL in the parameter list.

Hansvb

  • Hero Member
  • *****
  • Posts: 929
Re: New version of LazMapViewer
« Reply #11 on: June 13, 2026, 09:26:30 am »
thanks, if I see it correctly in mvengine_mapreg.inc then they all have a max zoom of 18 or 19.
If I want to add something to it, can I recompile the package myself? Will be something for my todo list but is good to know in advance.

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: New version of LazMapViewer
« Reply #12 on: June 13, 2026, 12:09:27 pm »
You must have an old version of LazMapViewer then. Half a year ago, there was an update (also in OPM) which supported zoom levels up to 21 for some providers.

Beyond that, you can define your own provider in your application. Here is an example:
Code: Pascal  [Select][+][-]
  1. uses
  2.   ..., mvMapProvider;
  3. procedure TForm1.FormCreate(Sender: TObject);
  4. begin
  5.   RegisterMapProvider(
  6.     'Yandex',    // Name to be used in MapView for "MapProvider"
  7.     ptEPSG3395,  // projection type
  8.     'https://core-renderer-tiles.maps.yandex.net/tiles?l=map&x=%x%&y=%y%&z=%z%&scale=1&lang=en_US&maptype=future_map',
  9.     0, 21,       // min/max zoom level
  10.     4);          // number of servers
  11.   MapView.MapProvider := 'Yandex';
  12.   MapView.Active := True;
  13. end;
(Please note that Yandex requires to display their logo in the map, but note also that MapView ATM does not have a plugin to display a logo...).

Of course you can recompile the LazMapViewer package, but note that changes affecting the designmode require also to rebuild the entire IDE ("Tools" > "Build Lazarus with Profile...")

 

TinyPortal © 2005-2018