Recent

Author Topic: Setup landmap - databse  (Read 1012 times)

WimVan

  • Jr. Member
  • **
  • Posts: 85
Setup landmap - databse
« on: March 23, 2023, 08:41:53 am »
Sorry for the strange title.
I want to show places on a landmap using coordinates coming from a database.
I wrote a whole package, website with javascript and PHP in which I can show images and if wanted the place where the image was taken using maps.google and the needed Javascript-instructions. (https://www.fotospotter.be)
This website is just a window to a photo-managing-system.
Now, I'm rewriting the php, ... into lazaruis so it can be used for local photo-managingapp.  All is converted and is working well, except, I do not see how to use the coordinates I have in a database and showing up a landmap with a marker.  I alrteady tried TMapviewer and this works but to slow.  It can take some minutes when I move the map, ...
So, can someone explain me short how I can conver the idea from PHP-Webbrowser to Lazarus - ? 
Should I use there a webbrowser too ?  If yes, which type ?  I only need to show a map and using javascript.
Any way thanks for reading this question.

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: Setup landmap - databse
« Reply #1 on: March 23, 2023, 10:05:33 am »
I alrteady tried TMapviewer and this works but to slow.  It can take some minutes when I move the map, ...
Assuming that you are talking about the LazMapViewer package on OPM? I agree that TMapView is not ultra-fast, but some minutes? - No. You must be doing something wrong. Did you activate multi-threading (MapView.UseThreads := true) and image caching (MapView.CacheOnDisk := true)?

WimVan

  • Jr. Member
  • **
  • Posts: 85
Re: Setup landmap - databse
« Reply #2 on: March 23, 2023, 10:36:38 am »
It is very slow.  Especially when I want zooming in, move the map  ....
I'll see to post the source I wrote this evening.
But on the onther hand, If I could reuse the javascripts I made to show tracks, markers ... as I made them for the web, it shoud save me a huge amount of testing and time...

Any way thanks for the tip.

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: Setup landmap - databse
« Reply #3 on: March 23, 2023, 03:00:30 pm »
Did you try the fulldemo which comes with the LazMapViewer package? Does is have the same slowness?

WimVan

  • Jr. Member
  • **
  • Posts: 85
Re: Setup landmap - databse
« Reply #4 on: March 23, 2023, 03:31:15 pm »
I saw that there is a newer version (beta-version ?).  I found the link somewhere on the forum.
Downloaded it, installed it and mapping is now quick.
But, now I have to look how I can project a track ....
How I can set multiple markers with a number in each marker an link it to an image and vice versa

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: Setup landmap - databse
« Reply #5 on: March 24, 2023, 03:10:49 pm »
But, now I have to look how I can project a track ....
There are two demos in the package to demonstrate how to draw tracks from track files. Not sure whether this is in the OPM version, but the svn version is working for sure (just checked it). To get the svn version download the snapshot from https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/lazmapviewer/, or use svn.

How I can set multiple markers with a number in each marker an link it to an image and vice versa
Setting map points is demonstrated in the fulldemo. Unfortunately, there is only one map marker icon at the moment. I tried to use an imagelist to provide a variety of marker icons, but never was able to complete it because of unresolved painting issues (https://gitlab.com/freepascal.org/lazarus/ccr/-/issues/39017).

WimVan

  • Jr. Member
  • **
  • Posts: 85
Re: Setup landmap - databse
« Reply #6 on: March 25, 2023, 03:11:31 pm »
Thanks and I tried this some days ago (before my question).
There occurs a huge waiting stage when you want zooming in ....

As long that the track fits in the window, no problem, but once you zoom to much .... I got a white screen and can start drinking a coffee.
There are some advantages when you can really use googlemap in a browser.  Streetview is one of it....

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Setup landmap - databse
« Reply #7 on: March 25, 2023, 05:22:15 pm »
If you have a huge delay there is something terribly wrong with your code.
And we have not seen any proper code.
Plz help us helping you with proper and reproducable complete code. Does not have to contain everything.
Usually it takes seconds, not years.
- Focus on the zoom and paint.
- Focus on the number of requests you make.

If you have these two well implemented you should see little or no difference between your program or a browser.
« Last Edit: March 25, 2023, 05:31:56 pm by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018