Default Map

Started by rienvanham, December 23, 2023, 06:22:21 PM

Previous topic - Next topic

rienvanham

Hi Mario,

Perhaps I'm doing something stupid (or have I done): everytime I start iMatch the map shown is OpenstraatMap. Off course I can change it to Google Maps (Satellite) (which I prefer) but after restarting iMatch it is OpenstreetMap again.

I searched for a setting but can't find it.

Another issue is that the map doesn't refect the location of a selected file anymore.

Thanks again!

Mario

This does not happen out of the blue. Something must have changed before. Any idea?
Are there any warnings in the IMatch log file (log file)
Is your Google API key valid?

Open the Map in your web browser (IMatch must be running) using this URL:

http://127.0.0.1:50519/imatch/apps/FEATURES/mapapp/index.html

You might need to change the port number if IMatch picked another port (see Info & Activity Panel or Dashboard).

Press <F12> to open the Developer tools in your browser.
Activate the "Console" tab.
Switch to Google Maps
Check the Console tab for error messages or similar.

Switch to another file in IMatch.
Check the Console tab for warnings or similar.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

Hi Mario,

I got some errors:


Mario

There are OK.
Anything in the log file?
The Map Panel falls back to OpenStreetMap when there is a problem connecting to the selected service or the Map fails to load.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

Sorry Mario,

But the log is hard to read for me. I've added it as an attachment. If needed I can do the same in debugmode

Mario

The log is clean, only a warning about a missing spell checker dictionary. This prevents IMatch from doing spell-checking in the Metadata Panel, Keywords Panel and Attributes Panel. See Download Dictionaries for Common Languages for more info.

So, we have two effects.

1. The Map Panel does not remember the selected map provider
2. Files no longer show their position on the map?

Not even when you run the Map Panel in your web browser? Hm.

For 1.

Run the Map Panel in your web browser. Enable the developer tools with <F12>.
This time, switch to the "Network tab". This shows us the communication between the Map and the provider and the communication between IMatch and the Map.

Now, open the configuration and switch to Google Maps or OpenStreetMaps, depending on what is currently selected.
Close with OK.

You will now see a lot of stuff in the Network tab.
Use the filter at the to to filter for data. I expect to see something like this:

Image2.jpg

This is the Map Panel app storing the modified configuration data in the IMatch settings database.
If this does not happen or there is an error, the configuration would not be saved and the Map Panel would fall back to the OSM provider.

For 2.

Select an image.
Left-click into the Map to place the target marker.
Click on the yellow check box button on the left of the Map Panel toolbar to save the coordinates.
Do they stick? Switch to another image and back to the first image. Coordinates still there?

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

#6
For 1: I got this response (file)

Could it have something to do with this message (never seen this so far):

One (or more) of your cameras cannot be found in the photools.com camera database. The Map Panel will use a default crop factor of 1 to render the field of view indicator for these cameras. If you wish to help improve the database, please click here to learn more....

For 2: Yes, the coordinates stay there


rienvanham

Hi Mario,

I think I found the problem: This is the response:



Do I need a new Google-token?

Mario

This tells me that IMatch is storing the configuration (google-satellite), unless IMatch responded to the data... request with an error. In that case you would see the line in read.

In that case I would expect an error or sorts when you close IMatch and the browser and then:

1. Open IMatch again.
2. Open the browser without entering an URL and enable developer mode with <F12>
3. Switch to the network tab
4. Enter the URL of the IMatch Map Panel

The Map will perform a data call again to fetch the stored configuration data stored earlier. This will look like in your screen shot, but this time the data travels from IMatch into the Map Panel app. The google-satellite should be restored as the map provider. Or there should be some warnings in the Console panel or lines in red in the network panel.



If the location stays and the pin is placed on the map, which do no pins show for your other files (question 2)?
When you look at the settings in the Map Panel, is the option "Automatically Center on focused file" enabled? Else the map will not move to bring the focused file into view.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Quote from: rienvanham on December 24, 2023, 11:33:20 AMHi Mario,

I think I found the problem: This is the response:



Do I need a new Google-token?
This was my first question. If your Google API key is valid.
Apparently you have not entered one or it has been invalidated by Google. Maybe there was some issue or the credit card is expired. You need to check the API  key or create a new key.

See Google Maps API Key
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

Hi Mario,

Until so far I never payed something to Google (monthly amount to pay was always 0 Euro) and my bankcard is not expired. I created a new key. CTRL-M - G works fine (reverse geocoding), the location on the map is reflected with the photo.

So, the only thing that still doesn't work is remembering the default map.

I will redo your first suggestion to see if the error still excists.

And: sorry for all inconvenience: I'm just a "simple" user and didn't get any warning/message from iMatch that something was wrong with the key.

rienvanham

#11
The response is now: {"result":"ok"}

{"version":7,"mapType":"osm","showFileData":false,"showImages":false,"showLocations":false,"followFocus":true,"showFileTrack":false,"mapCenter":{"lng":5.4380560000000004,"lat":52.252444},"findText":"hindeloopen+het+oost","findTarget":"Nijmegen+Station+NS","lockMove":false,"selectTool":"circle","selectToolUseShownCoordinates":true,"selectScope":"scope","trackLog":{"trackTimeShift":"0","ignoreFilesWithGPS":true,"files":["E:\\Bestanden\\Mijn+Documenten\\Vervoer\\GPS+Tracks\\FIetsen\\2023\\2023-08-10+-+Roosteren+-+Thorn+-+Echt+-+Susteren.gpx","E:\\Bestanden\\Mijn+Documenten\\Vervoer\\GPS+Tracks\\FIetsen\\2023\\2023-08-11+-+Well+-+Arcen.gpx","D:\\Mijn+Documenten\\Downloads\\2023-09-16_1311323893_Fietsroute+langs+het+strand.gpx","D:\\Mijn+Documenten\\Downloads\\2023-09-15_1309710439_Fietstocht+naar+Stommeermolen.gpx","E:\\Bestanden\\HiDrive\\Mijn+Documenten\\Vervoer\\GPS+Tracks\\FIetsen\\2023\\2023-07-17+-+Bolsward+naar+Lemmer.gpx"],"folders":[],"rememberFolder":true,"timeThresholdInSeconds":"300"},"fieldOfView":"off","privacyPolcyAgreement":true,"zoomLevel":19,"showApplyTargetMarkerPromt":false,"usagePolicyInfoShown":true}

And the second:

{"version":7,"mapType":"google-satellite","showFileData":false,"showImages":false,"showLocations":false,"followFocus":true,"showFileTrack":false,"mapCenter":{"lng":5.4380560000000004,"lat":52.252444},"findText":"hindeloopen+het+oost","findTarget":"Nijmegen+Station+NS","lockMove":false,"selectTool":"circle","selectToolUseShownCoordinates":true,"selectScope":"scope","trackLog":{"trackTimeShift":"0","ignoreFilesWithGPS":true,"files":["E:\\Bestanden\\Mijn+Documenten\\Vervoer\\GPS+Tracks\\FIetsen\\2023\\2023-08-10+-+Roosteren+-+Thorn+-+Echt+-+Susteren.gpx","E:\\Bestanden\\Mijn+Documenten\\Vervoer\\GPS+Tracks\\FIetsen\\2023\\2023-08-11+-+Well+-+Arcen.gpx","D:\\Mijn+Documenten\\Downloads\\2023-09-16_1311323893_Fietsroute+langs+het+strand.gpx","D:\\Mijn+Documenten\\Downloads\\2023-09-15_1309710439_Fietstocht+naar+Stommeermolen.gpx","E:\\Bestanden\\HiDrive\\Mijn+Documenten\\Vervoer\\GPS+Tracks\\FIetsen\\2023\\2023-07-17+-+Bolsward+naar+Lemmer.gpx"],"folders":[],"rememberFolder":true,"timeThresholdInSeconds":"300"},"fieldOfView":"off","privacyPolcyAgreement":true,"zoomLevel":19,"showApplyTargetMarkerPromt":false,"usagePolicyInfoShown":true}

Mario

#12
Google normally displays the error directly on the map when the key is missing or invalid.
The saving of the data looks OK. Google maps is specified as the map provider. Do the check I've explained to see if the data retrieved when the map loads also has Google and if the map panel logs some errors when it tries to restore the map provider.

Google is special. HERE, OSM, BING all use the OpenLayers toolkit. OpenLayers stopped supporting Google because of privacy and license issues. So I have to maintain Google separately in the map panel (PITA).

In order to not send IP address and other data to Google from users who don't want to use Google for privacy reason, IMatch loads the Google maps JavaScript libraries only when the user has specified Google as the map provider. This step then sends your IP address etc. to Google. If this fails, the map panel will not load. Or Google will include an error message in the map tiles or log it to the console.

QuoteAnd: sorry for all inconvenience: I'm just a "simple" user and didn't get any warning/message from iMatch that something was wrong with the key.

Me too :)
I have to make users enter their own license keys since I cannot afford to pay for map panel usage and reverse geocoding for all IMatch users.

Adobe has a deal with Google and requires all Lightroom users to use only Google Maps exclusively.
I'm sure there is a lot of data flowing from Adobe to Google to reduce the amount of money Adobe has to pay for the map usage of Lr uses. And there are surely volume rebates, too. The map panel is one of the things that dies in Lr as soon as you discontinue your annual subscription.

Google and Microsoft offer some generous monthly free quota so I doubt IMatch users will ever have to actually pay money. For legal and tracking reasons, Google requires a credit card since a few years back, even if the monthly quota is never used up.

Sometimes, for unknown reasons, an API key becomes invalidated by Google. Maybe they detect a security issue or something. Then the user has to create a new key for IMatch. I have no influence on this and don't get notified. The owner of the key gets notified or the map shows error texts like "only for development purposes" on top of the tiles.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

Thanks again Mario and have a nice Christmas. I ((and hopefully everybody) won't send any questions to you so you can enjoy Christmas without disruptions.

Cheers,

Rien.

JohnZeman

For what it's worth just recently I started experiencing the same issue.  After rebooting the computer and launching IMatch the map panel defaults to Open Street map every time.  No errors from Google and all I have to do each time is to tell the map panel to use Google instead and all is fine.
Merry Christmas to all and to all a very happy new year!

Mario

#15
One user affected, that's a support case.
Two users affected, that feels like a bug...

Well, this is embarrassing

I've forgotten to uncomment a leftover from a test. The Map Panel always switches to OSM because of that.

Please download the attached ZIP file and extract the app.js file contained in it.

Close IMatch.
Replace the file

c:\ProgramData\photools.com\IMatch6\webroot\imatch\apps\FEATURES\mapapp\src\app.js
with the version in the ZIP file.

Start IMatch and open the Map Panel.
Click into it and press <Ctrl>+<F5> a few times to force a reload without caching.

The Map Panel will now again remember the selected map provider.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

YES!! It works again!

Thanks a lot guys!

Have a merry Christmas and a fantastic 2024!

JohnZeman

All is well here too now, thanks for the quick fix Mario and Merry Christmas to all!

pmcabinet

Yes, I had this problem. Map remembers Google now, thanks Mario. Happy New Year!