Recent

Author Topic: lazMapViewer: can't move component  (Read 1296 times)

Willie68

  • New member
  • *
  • Posts: 8
lazMapViewer: can't move component
« on: September 08, 2025, 05:53:17 pm »
Hi there,
Hope you can help me.
I installed the Mapviewer, IDE recompiled and everything seems Ok.
But when I try to add the MapViewer to a panel I get the error: "Komponent konnte nicht verschoben werden"
and the Mapviewer is not present.
It's a german Installation.
It's a fresh installation of Laz 4.2

n7800

  • Hero Member
  • *****
  • Posts: 557
  • Lazarus IDE contributor
    • GitLab profile
Re: lazMapViewer: can't move component
« Reply #1 on: September 08, 2025, 06:17:32 pm »
I have "TMapView" add working. I checked v4.2 and trunk, and even the German version ))

Is the package installed via Online Package Manager?

What OS?

But when I try to add the MapViewer to a panel I get the error: "Komponent konnte nicht verschoben werden"

How exactly do you add the component? By clicking in the component palette, and then clicking in "TPanel" on the form?

The error only appears when adding to "TPanel", or on the form as well?

wp

  • Hero Member
  • *****
  • Posts: 13226
Re: lazMapViewer: can't move component
« Reply #2 on: September 08, 2025, 07:10:15 pm »
But when I try to add the MapViewer to a panel I get the error: "Komponent konnte nicht verschoben werden"
Is this error message exact? I cannot find it in the entire Lazarus and ccr directories. Which third-party packages are used by your application?

Willie68

  • New member
  • *
  • Posts: 8
Re: lazMapViewer: can't move component
« Reply #3 on: September 09, 2025, 09:41:51 am »
I have "TMapView" add working. I checked v4.2 and trunk, and even the German version ))

Is the package installed via Online Package Manager?
I tried both... via package manager or via donwload/ install .lpk

What OS?
Windows 11

But when I try to add the MapViewer to a panel I get the error: "Komponent konnte nicht verschoben werden"

How exactly do you add the component? By clicking in the component palette, and then clicking in "TPanel" on the form?
Clicking on the component in the component palette, than clicking on the TPanel.

The error only appears when adding to "TPanel", or on the form as well?
Even appears, when i add it to a new application.

But when I try to add the MapViewer to a panel I get the error: "Komponent konnte nicht verschoben werden"
Is this error message exact? I cannot find it in the entire Lazarus and ccr directories. Which third-party packages are used by your application?

excat message is (see screenshot)
"
Fehler beim Verschieben der Komponente
Fehler beim Verschieben der Komponente
MapView1: TMapView
"
It occurs even in a new application without any other components, only the basic TForm

PS.: added the english version of the message.
« Last Edit: September 09, 2025, 09:45:46 am by Willie68 »

Willie68

  • New member
  • *
  • Posts: 8
Re: lazMapViewer: can't move component
« Reply #4 on: September 09, 2025, 10:14:36 am »
if i add this programatically, it works...
« Last Edit: September 09, 2025, 10:19:12 am by Willie68 »

n7800

  • Hero Member
  • *****
  • Posts: 557
  • Lazarus IDE contributor
    • GitLab profile
Re: lazMapViewer: can't move component
« Reply #5 on: September 09, 2025, 12:32:16 pm »
Thanks, from the message text it is clear that the error is called somewhere in these lines. This is a good start for debugging.

n7800

  • Hero Member
  • *****
  • Posts: 557
  • Lazarus IDE contributor
    • GitLab profile
Re: lazMapViewer: can't move component
« Reply #6 on: September 09, 2025, 01:24:47 pm »
Just to make sure - does the error occur without docked Designer? To do this, remove the "DockedFormEditor" package for testing.

Willie68

  • New member
  • *
  • Posts: 8
Re: lazMapViewer: can't move component
« Reply #7 on: September 09, 2025, 01:35:05 pm »
Yes, same message.

How can i start the IDE in debug mode?

wp

  • Hero Member
  • *****
  • Posts: 13226
Re: lazMapViewer: can't move component
« Reply #8 on: September 09, 2025, 02:58:16 pm »
Load the project "lazarus.lpi" (in (lazarus)/ide). But it's hard to keep track of which IDE is the debugging and which is the debugged IDE...

Before doing so start the IDE with logging enabled: Use the commandline argument "--debug-log=<logfile>" (no quotes) where <logfile> is the name of the file into which debug messages are written. Start this IDE, do all needed to trigger the error, then close the IDE again. Open the logfile and study it, or upload it here.

I tried several attemps with Win-11 and Laz/main+fpc 3.2.2+MapViewer from ccr, and with Laz 4.2+fpc-3.2.2 + Mapviewer from OPM, with docked and with normal IDE, with and without docked form editor, and never get this issue. Are there any non-standard components installed in your system? Can you start a clean IDE, i.e. in "View" > "IDE Internals" > "About IDE" find the name of your configuration folder in "Primary config directory"; exit the IDE, rename this config directory so that the IDE does not find it again, restart the IDE. This starts with default settings, you will have to reinstall the MapViewer to test for the bug again.


Willie68

  • New member
  • *
  • Posts: 8
Re: lazMapViewer: can't move component
« Reply #9 on: September 09, 2025, 08:00:04 pm »
Very strange.
I tried the same thing on my home PC, a small, sleek machine (i9, 32 GB, Windows 11), and it worked perfectly.
Now i have to work out, whats the difference.
I think, first i simply reinstall lazarus...

n7800

  • Hero Member
  • *****
  • Posts: 557
  • Lazarus IDE contributor
    • GitLab profile
Re: lazMapViewer: can't move component
« Reply #10 on: September 09, 2025, 08:29:28 pm »
Please save your configuration folder (see the path to it in Menu > View > IDE Internals > About IDE, line "Primary config directory="). It may contain a "key" to the error.

By the way, during installation you can specify "secondary installation" to create an IDE with a separate configuration, but it is still recommended to make a backup of the old one.

wp

  • Hero Member
  • *****
  • Posts: 13226
Re: lazMapViewer: can't move component
« Reply #11 on: September 09, 2025, 10:31:31 pm »
Before reinstalling Lazarus I would
- rebuild a clean IDE ("Tools" > "Configure Build Lazarus" > check "Clean all" and "Switch after building to automatically" > "Build")
- use default settings (like n7800 and I already have explained)
- make sure that your project folder and the Lazarus folder are white-listed for your anti-virus software

Willie68

  • New member
  • *
  • Posts: 8
Re: lazMapViewer: can't move component
« Reply #12 on: September 10, 2025, 09:29:39 am »
So, i'm back on my working pc. (I7 Ultra, 64GB, Win 11)
First: the log file is attached

essence:
Access violation
  Stack trace:
  $0000000100D8C64A  GETHASRETINATILES,  line 175 of source/mvmapprovider.pas

after adding the map viewer in the designer to the form on my home pc, now the project can't be opend on my working maschine.
essence of log content, same access violation:
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $0000000100E8D45A  GETHASRETINATILES,  line 175 of source/mvmapprovider.pas

Clean build of ide -> no change
Reinstall with cleanup -> no change, which makes sense since the problem doesn't seem to be with Lazarus itself, but with the MapViewer.
Code: Pascal  [Select][+][-]
  1. 175: Result := (FGetRetinaStr[Layer] <> nil) and (FGetRetinaStr[Layer]() <> '');
« Last Edit: September 10, 2025, 10:29:10 am by Willie68 »

Willie68

  • New member
  • *
  • Posts: 8
Re: lazMapViewer: can't move component
« Reply #13 on: September 10, 2025, 10:23:49 am »
Even i dont know, why this is only triggerd on one of my maschines, but i fixed this in the mvengine.pas in the map viewer.

How can i provide this fix to the Component?

wp

  • Hero Member
  • *****
  • Posts: 13226
Re: lazMapViewer: can't move component
« Reply #14 on: September 10, 2025, 10:31:14 am »
You seem to use a monitor with higher-than-standard resolution. Switching to 144ppi I can confirm the issue. The crash happens because with a high-dpi monitor the procedure DoAutoAdjustLayout is entered, and this calls the engine's UseRetinaTiles. Since there is no MapProvider when you drop the mapviewer component on the form at designtime, this routine must crash in the line "if MapWin.MapProvider.HasRetinaTiles". Putting a nil-check in front of it fixes the issue:
Code: Pascal  [Select][+][-]
  1. procedure TMapViewerEngine.UseRetinaTiles(OnlyIfAvailable: Boolean);
  2. ...
  3.   if OnlyIfAvailable then
  4.   begin
  5.     if (MapWin.MapProvider <> nil) and MapWin.MapProvider.HasRetinaTiles then
  6.       mvTypes.TileSize := RETINA_TILE_SIZE
  7.     else
  8.       mvTypes.TileSize := NORMAL_TILE_SIZE;
  9.   end else
  10.     mvTypes.TileSize := RETINA_TILE_SIZE;
  11. ...
Committed the fixed version to svn.

 

TinyPortal © 2005-2018