Author Topic: EXPERIMENTAL: OpenLayers Map Panel  (Read 5190 times)

thrinn

  • Hero Member
  • ***
  • Posts: 594
EXPERIMENTAL: OpenLayers Map Panel
« on: August 05, 2013, 07:36:39 PM »
Hi folks,
Mario was hinting that the Google Maps panel will most likely not make it into the final version due to licensing issues. I will miss this functionality, so I decided to give it a try and play around a bit with the all-new IMatch App concept. Someone (maybe Mario himself?) mentioned OpenLayers a an OpenStreetMap bases possible replacement. As OpenLayers is an JavaScript library it should integrate nicely with the IMatch App concept.

Unfortunately, I have no experience neither in JavaScript nor in the OpenLayers API, so there was a lot of trial and error. At the moment the result is more a proof of concept than anything else. But nevertheless, it works! (For me, that is...)

How to install:
Simply extract the ZIP archive to a folder in the IMatch5 User App folder. In a standard installation (at least when using Windows 7) the base folder for User Apps is to be found under:
%PROGRAMDATA%\photools.com\IMatch5\apppanel\user
Extracting the ZIP should give you a sub folder named "OpenLayers Map Panel" containing 4 files.

If IMatch was running during the installation, you should restart IMatch or at least close all App Panels. Then, open an App Panel (View -> Panels -> App Panel 1). You should find a new entry in the drop down list at the top of the panel, called "OpenLayers Map Panel".

The Map Panel shows a marker for each selected file in the result window. If more than one file is selected, the zoom level is adjusted so that all markers fit into the App Panel window. That works most of the time, but not always. Don't know why...

The App relies on location (GPS) info being present in the image files. It uses the parseVariables method to retrieve the GPSLatitude/GPSLongitude values and passes these values on to the OpenLayers API. There is no error checking at the moment, so please use it at your own risk  ;) .

There is no more functionality. It would be nice to have some customization options (e.g. which rendering layout to use) but for that one has to dive a bit deeper into the OpenLayers API. Not enough time for that. Any suggestions are welcome!

Regards,
Thorsten




[attachment deleted by admin]
Thorsten
Win 10 / 64, IMatch 2018, IMA

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #1 on: August 06, 2013, 01:34:05 AM »
Thanks! Your app does work, but subject to the issue I identified in https://www.photools.com/community/index.php?topic=335.msg2499#msg2499

That is, I have to open openlayers_map.htm in Notepad++, make a minor change (e.g., an extra space somewhere) and then re-save it. Apparently this has to do with the character set encoding used for the HTML page (e.g. if the file is stored in UTF-8 with BOM or ASCII or whatever).

But once I make this fix, your app seems to work just fine. I did notice a few minor glitches but I can't reproduce them at the moment (and I think I've seen similar behavior a few times with Mario's map app...).

Great work!



John

Ferdinand

  • 100 years since I was shot and a war was started
  • Global Moderator
  • *****
  • Posts: 1670
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #2 on: August 06, 2013, 08:15:24 AM »
Works here without modification.  Good Effort!

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #3 on: August 06, 2013, 08:35:23 AM »
IMatch assumes that the App HTM is in UTF-8 encoding (make sure the editor you use can handle this, e.g. Notepad does) and also states that in the <meta> header. Internet Explorer is very picky about this, and depending on the system character set and blabla it will just refuse to run script code if this rule is broken.

BenAW

  • Sr. Member
  • **
  • Posts: 423
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #4 on: August 06, 2013, 09:38:52 AM »
Hi Thorsten

thanks for this App. Initially it didn't work for me, but using the same trick as jch2103 I added an empty line somewhere in openlayers_map.htm with Notepad ++, saved it and it worked right away.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #5 on: August 06, 2013, 02:57:11 PM »
Works straight away for me too.  The one odd thing though was I checked the encoding immediately after unzipping the files and it was UTF-8, so I didn't have to change anything.

This is a nice app Thorsten, it's good to have another way to access a GPS map in case Mario has to remove his map panel.

BenAW

  • Sr. Member
  • **
  • Posts: 423
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #6 on: August 06, 2013, 05:02:03 PM »
it's good to have another way to access a GPS map in case Mario has to remove his map panel.
Hi John
I still have this Geotagger page running on my server. It's a bit dated, but if you (or anyone else) want to use it as a base for another GPS map, great. I think StreetView can be included relatively easy, and Geotagger already communicates by putting coordinates into the Clipbord. Should be simple to change that into an IM5 variable.
I intend to look into this programming thing coming winter.

Here's the link: http://geotagger.wtrs.nl/gps.php
« Last Edit: August 06, 2013, 06:24:39 PM by BenAW »

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #7 on: August 06, 2013, 05:50:08 PM »
Thanks Ben, I will take a look at that once my life slows down a bit.
Very recently I had to move both of my parents out of their house and into a nursing home, at the moment I'm still dealing with the aftermath of all that.

thrinn

  • Hero Member
  • ***
  • Posts: 594
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #8 on: August 09, 2013, 06:49:03 PM »
Quote
IMatch assumes that the App HTM is in UTF-8 encoding
I use UltraEdit as editor which is unicode aware. And I double checked the htm and xml files. They are definitely UTF8 (I checked the BOM in hex mode: EF BB BF).

BUT: The styles.css file was not UTF8. Well, I did not change that file, just copied it from the BasicApp.

I attached the ZIP again, all 4 files are UTF8 now. Please test if it works now without changing anything. I can't check for myself - it did work before and it works now on my PC. I am using Internet Explorer 10 (10.0.9200.16635) on Windows 7 64bit.


[attachment deleted by admin]
Thorsten
Win 10 / 64, IMatch 2018, IMA

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #9 on: August 09, 2013, 07:04:07 PM »
Quote
BUT: The styles.css file was not UTF8.
This is not required. The browser just requires that for the HTML file when the meta tag specifies this. But I'll change the style sheet anyway for the next release, just in case.

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #10 on: August 09, 2013, 07:04:43 PM »
Please test if it works now without changing anything.

Sorry, still same problem for me (Win 7/64, IE 10). Same fix for me: minor edit of openlayers_map.htm in Notepad++, save. Works great then.

John

cytochrome

  • Hero Member
  • ***
  • Posts: 540
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #11 on: August 12, 2013, 09:27:49 PM »
Works fine out of the box here too, no tweaking needed (win 7x64, IE 10 - 10.0.9200.16635).

If this is to be developed (if Mario does not find an alternative to GM) it would be interesting to make a version for off line maps. It is faster, does not require a connexion (several smartphone GPS application operate along these lines with maps that don't consume data).

An other benefit is that often several OSM maps coexist for a given territory, some are better for walking. For example in France the FreizeitKarte_FRA shows elevation lines. For Germany should be the same obviously.

Anyway thanks for the effort, even without further options it is already useful.

Francis
« Last Edit: August 12, 2013, 09:32:24 PM by cytochrome »

trouble

  • New Members
  • *
  • Posts: 4
Re: EXPERIMENTAL: OpenLayers Map Panel
« Reply #12 on: November 07, 2015, 04:42:44 PM »
Re: Google Maps;

As An Option, Wouldn't there be a way each 'license' of IMatch 5 -> If they want to use google maps they can sign up for their own developer id?   If we each used our own, and placed it into the application, that should alleviate any cost, and/or at the very least apply the cost to the person using that much. Google allows for many calls per developer. Unfortunately with software such as this, there's also many calls per person equating to the cost for the original developer.

If this is or could be an option, then we could list the signup here in the forum?

Just a thought :D
~elaine.
P.S. Have I mentioned I love your software!