Locus Map - forum

Support => Troubles & Questions => Topic started by: bongo on November 30, 2011, 08:24:59

Title: Weird interpretation of <url> within gpx file
Post by: bongo on November 30, 2011, 08:24:59
i need to open a html page from within a waypoint description. this can e.g. be done by defining an url in the waypoint description within the gpx file.
unfortunately, locus shows a weird behaviour in using the url definition. here's what i found:

if there's no url defined:
locus itself generates an url for it's hotlink: http:// (//http://)<address of geocaching page>/wp=<waypointname>
trying to open the online cache description

if there is an url definition starting with "http://":
locus uses the defined url.

if there is an url definition starting with anything but "http://":
locus does nothing when clicking on the hotlink.

my problem is, that i do not want to open an online url. i need to open a local html file, i.e. my url does not start with "http://" but with "file://", so locus seems to ignore this url  :evil:

there is also a way to use links within a cache description, as it can be found within groundspeak pocked queries. these links are ignored by locus.

so how can i generat a link to a local file from within locus  :?:  :?:  :?:  :?:  :?:  :?:
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on November 30, 2011, 10:24:04
Hi Bongo,
  I need some more information ...

1. if listing contain <a href="file:// ...">X</a> tag, it should work. Tapping on this link should open local file
2. if you place html description under folder locus/data/geocaching/cacheCode.html (should be also in subdirectory under geocaching directory), locus will show new "spiler" tab in main geocaching screen
3. nice description from you, but I need some file for testing. So try points I menitoned above, and if this will not work, send me some sample data to test
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on November 30, 2011, 11:57:21
hi menion
thanx for the help. i checked this out:

1. depending on where i put the <a href="file:// ...">X</a>, the gpx crashed on import or there was no hotlink in the listing shown.
    where can i find an example gpx file with such references?

2. magic! putting the html files in the right position really works. but unfortunately, pictures within the html files do not show up. i have not yet found out why. i need to further study this. i think relative pathes to images should work, right?

thanx!
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on November 30, 2011, 12:11:48
1. do you have this link in CDATA tag? like this .. <![CDATA[<a href="file:// ...">X</a>]]>
2. yes, there have to be relative or correct absolute paths, this should work
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 01, 2011, 07:22:44
don't know if i should split up my questions into multiple posts...
or i try here with multiple posts:

1)
i can't get the thing with the references working.
so i put a gpx snippet from my gpx for a single geocache below.
can you please insert a link there which is able to open "file://sdcard/Locus/data/geocaches/2T/GC2T8W6.htm"?
so i can see how and where to put it.
thanx a lot for your help!



 <wpt lat="46.9206" lon="7.4138">
  <time>2011-04-19T08:00:00Z</time>
  <name>GC2T8W6</name>
  <desc>Schloss Köniz by scma (1.5/1)</desc>
  <url>http://www.geocaching.com/seek/cache_details.aspx?guid=18c481f1-d6d7-43c5-bfef-09827d94106d</url>
  <urlname>Schloss Köniz by scma</urlname>
  <sym>Geocache</sym>
  <type>Geocache|Multi-cache</type>
    <gsak:wptExtension xmlns:gsak="http://www.gsak.net/xmlv1/5">
      <gsak:UserFlag>true</gsak:UserFlag>
      <gsak:Lock>false</gsak:Lock>
      <gsak:DNF>false</gsak:DNF>
      <gsak:Watch>false</gsak:Watch>
      <gsak:UserData></gsak:UserData>
      <gsak:FirstToFind>false</gsak:FirstToFind>
      <gsak:User2>E</gsak:User2>
      <gsak:User3></gsak:User3>
      <gsak:User4>     </gsak:User4>
      <gsak:County>Bern</gsak:County>
      <gsak:UserSort>0</gsak:UserSort>
      <gsak:SmartName>SchlossKni</gsak:SmartName>
      <gsak:LastGpxDate>2011-09-29</gsak:LastGpxDate>
      <gsak:Code>GC2T8W6</gsak:Code>
      <gsak:Resolution></gsak:Resolution>
    </gsak:wptExtension>
  <groundspeak:cache id="2189228" available="True" archived="False" xmlns:groundspeak="http://www.groundspeak.com/cache/1/0/1">
   <groundspeak:name>Schloss Köniz</groundspeak:name>
   <groundspeak:placed_by>scma</groundspeak:placed_by>
   <groundspeak:owner id="2445023">scma</groundspeak:owner>
   <groundspeak:type>Multi-cache</groundspeak:type>
   <groundspeak:container>Small</groundspeak:container>
   <groundspeak:attributes>
     <groundspeak:attribute id="1" inc="1">Dogs allowed</groundspeak:attribute>
     <groundspeak:attribute id="6" inc="1">Recommended for kids</groundspeak:attribute>
     <groundspeak:attribute id="7" inc="1">Takes less than an hour</groundspeak:attribute>
     <groundspeak:attribute id="13" inc="1">Available at all times</groundspeak:attribute>
     <groundspeak:attribute id="25" inc="1">Parking available</groundspeak:attribute>
     <groundspeak:attribute id="26" inc="1">Public transportation</groundspeak:attribute>
     <groundspeak:attribute id="32" inc="1">Bicycles</groundspeak:attribute>
     <groundspeak:attribute id="59" inc="1">Food Nearby</groundspeak:attribute>
   </groundspeak:attributes>
   <groundspeak:difficulty>1.5</groundspeak:difficulty>
   <groundspeak:terrain>1</groundspeak:terrain>
   <groundspeak:country>Switzerland</groundspeak:country>
   <groundspeak:state>Espace Mittelland (BE/SO)</groundspeak:state>
   <groundspeak:short_description html="False">Kleiner Rundgang auf dem Areal des Schloss Köniz</groundspeak:short_description>
   <groundspeak:long_description html="False">Geschichte
Das Könizer Schloss ist ein in mehreren Etappen aus dem Stiftsgebäude der Augustinerchorherren hervorgegangener Komplex mit imposantem Hauptgebäude und weitläufigem Wirtschaftshof. Das ummauerte Stiftsgebäude wurde gegen Ende des 11. Jahrhunderts erbaut, Anbau des Ritterhauses auf der Südseite und Anlage des Hofs um 1261. Im 14./15. Jahrhundert Verbauung des Freiraums zwischen Ringmauer und Westfront, im Wirtschaftshof Neubau der Ökonomiegebäude. 1610 Umbau des Hauptgebäudes in nachgotischen Formen, weitgehender Neubau des Westtrakts nach 1664.
Im 18. Jahrhundert Erneuerung der Gesamtanlage mit Neubauten im Wirtschaftshof und Umbauten im Hauptgebäude. Seit 1825 dient dessen Westtrakt als Pfarrhaus. Das Ritterhaus selbst ist ein mächtiger Rechteckbau unter hohem Walmdach in der Nachfolge zähringischer Donjons. Der stimmungsvoll inszenierte Wirtschaftshof mit dem Hofbrunnen und der imposanten Linde wird dominiert vom grossen, 1724 erbauten Kornhaus, das unter anderem als Standesamt dient. Auf der Westseite des Hofs wurde im 15./16. Jahrhundert das Haberhaus an die Ringmauer angebaut. Heute beherbergt es das Restaurant zum Schloss, die Musikschule Köniz und das Schulmuseum. Die Scheune aus der 2. Hälfte des 19. Jahrhunderts bildet den Ost-Abschluss des malerischen Hofs.
(nach: Kunstführer durch die Schweiz – Band 3)


Nun zum Rundgang (es müssen keine Privatgelände betreten werden)

Station 1 – Übersicht: N 46º 55.236     E 7º 24.828
Hier kannst du dir eine Grundlage verschaffen.
a = Ritterhuus - Pfarrhus
b = Rossstall - Wöschuus
c = Kirche

Station 2 – Musik: N 46° 55. a / b-a-c / c      E 7° 24. b / a+c / b-c
Über der Tür steht die Hausnummer, was steht aber für ein Zahl e (in blau) unter der Tür?
Gegen Norden siehst du einen erfrischenden Brunnen mit einer Jahreszahl f

Station 3 – typisch Köniz: N 46° 55.a / letzte Ziffer e / c    E 7° 24. 2. Ziffer e / b-a-3. Ziffer f / b
Du stehst auf einem für Köniz charakteristischen Objekt.
g = gegen Westen läuft ein Plattenweg, zähle alle Steinplatten im Gras bis zur Schwelle des Gebäudes (Quersumme = a+b+c)
h = über dem Portal südlich von dir steht eine Jahreszahl

Station 4 – waschen: N 46° 55.a / 3. Ziffer h / 3. Ziffer h - 2. Ziffer h      E 7° 24. 2. Ziffer g+c / 1. Ziffer g / 1. Ziffer f + 2. Ziffer f
Auf diesem Platz toben sich häufig Kinder und Jugendliche aus, von hier aus steigt man aber auch in den Ritterkeller ab.
j = Anzahl Wasserspender unter dem Dach
k = Am Dach des offenen Wöschüüsli siehst du 3 Samurai (k =2); 3 Schwinger (k = 3) oder 3 Fallschirmspringer (k = 4)
Gleich nebenan ist der Eingang zum Ritterchäller. Wie viele Nischen (m) hat es dort rechts der Türe im Sandstein?

Station 5 – Rückseite: N 46° 55.k / k+j / 2*m      E 7° 24.3. Ziffer h / a+2. Ziffer g / k+j
Nun ein Blick hinter die Kulissen. Wie viele Steine (n) schützen jeden Baum links und rechts gegen Verkehrsunfälle?

Station 6 – Final: N 46° 55.n+k-j / n+m-j / n-c      E 7° 24.2*n+k / 3*n / j*n

24.04.11: Listing bei Station 2 korrigiert

Additional Waypoints
PK2T8W6 - GC2T8W6 Parking
N 46° 55.195 E 007° 24.900</groundspeak:long_description>
    <groundspeak:encoded_hints>verboten</groundspeak:encoded_hints>
   <groundspeak:logs>
    <groundspeak:log id="-2">
    <groundspeak:date>2011-09-30T08:00:00</groundspeak:date>
    <groundspeak:type>Other</groundspeak:type>
    <groundspeak:finder id="0">GSAK</groundspeak:finder>
    <groundspeak:text encoded="False">*Spoiler Pictures*
 GC2T8W6 - Schlosshof.jpg
&lt;img src='file://D:geocachinggsakspoilersGC2T8W6 - Schlosshof.jpg'&gt;&lt;br&gt;&lt;br&gt;
GC2T8W6 - Sommerstimmung.jpg
&lt;img src='file://D:geocachinggsakspoilersGC2T8W6 - Sommerstimmung.jpg'&gt;&lt;br&gt;&lt;br&gt;
GC2T8W6 - Übersicht.jpg
&lt;img src='file://D:geocachinggsakspoilersGC2T8W6 - Übersicht.jpg'&gt;&lt;br&gt;&lt;br&gt;
*End Spoilers*
    </groundspeak:text>
   </groundspeak:log>
    <groundspeak:log id="188103980">
      <groundspeak:date>2011-09-23T19:00:00Z</groundspeak:date>
      <groundspeak:type>Found it</groundspeak:type>
      <groundspeak:finder id="3881767">sbeelis</groundspeak:finder>
      <groundspeak:text encoded="False">Den Anfang zu diesem Cache machten wir am Kibuk-Kindermedien-Festival. Nach den ersten 4 Posten konnte ich aber die Kids damals nicht mehr vom Heissluftballon und dem Bücherminigolf weglocken, so dass wir dort abbrachen. Später kam ich dann nochmals mit der Tochter zurück, da wir aber die Frage mit den Nischen total falsch verstanden und somit nach was falschem Gesucht hatten, landeten wir am falschen Ort und gaben auf. Ein netter Hint vom Owner half uns dann weiter und so konnten wir heute diesen Multi endlich zu Ende bringen. Danke für die tolle Tour auf dem schönen Schlossgelände.</groundspeak:text>
    </groundspeak:log>
    <groundspeak:log id="187311547">
      <groundspeak:date>2011-09-18T19:00:00Z</groundspeak:date>
      <groundspeak:type>Found it</groundspeak:type>
      <groundspeak:finder id="2822853">squirell99</groundspeak:finder>
      <groundspeak:text encoded="False">Wir lieben diese kleinen Multis wo man nicht Stunden laufen muss. Alle Zahlen gut gefunden. Die Suche des Finals dauerte nicht lange und wir konnten loggen. Gruss FLSG</groundspeak:text>
    </groundspeak:log>
    <groundspeak:log id="187232693">
      <groundspeak:date>2011-09-18T19:00:00Z</groundspeak:date>
      <groundspeak:type>Found it</groundspeak:type>
      <groundspeak:finder id="3153497">Rollsky</groundspeak:finder>
      <groundspeak:text encoded="False">Toller Multi an einem wundersch&amp;#246;nen Ort. Herzlichen Dank f&amp;#252;rs Auslegen.</groundspeak:text>
    </groundspeak:log>
    <groundspeak:log id="187228800">
      <groundspeak:date>2011-09-18T13:12:24Z</groundspeak:date>
      <groundspeak:type>Found it</groundspeak:type>
      <groundspeak:finder id="4879037">Caromania1984</groundspeak:finder>
      <groundspeak:text encoded="False">Das war ein interessanter multi. An einem verregneten sonntag konnten wir diesen so gut wie muggelfrei loggen. TFTC</groundspeak:text>
    </groundspeak:log>
    <groundspeak:log id="187021624">
      <groundspeak:date>2011-09-17T19:00:00Z</groundspeak:date>
      <groundspeak:type>Write note</groundspeak:type>
      <groundspeak:finder id="232870">tastom</groundspeak:finder>
      <groundspeak:text encoded="False">Anlässlich des Festes 150 Jahre Wasserversorgung Köniz zufälligerweise beim Cache vorbei gelaufen, der total "entblösst" da lag. Habe Tarnung wieder hergestellt.

This entry was edited by tastom on Saturday, 17 September 2011 at 19:42:52 UTC.</groundspeak:text>
    </groundspeak:log>
  </groundspeak:logs>
   <groundspeak:travelbugs>
   </groundspeak:travelbugs>
</groundspeak:cache>
</wpt>
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 01, 2011, 07:29:31
for point
2)

yes, this works, great!
but (there unfortunately is a but  :cry: ):

the html is shown and the pictures are there too, but there's a problem with some characters. the characters 'äöüÄÖÜ°' are all shown as a diamond with a '?'.
is there a problem with the html viewer within locus?
is there a way to correct this?
when opening the html from file manager, everything shows well, but from within locus, i get all these diamonds with a '?'.
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 01, 2011, 07:46:30
and an additional point
3)
if a geocache loaded from gpx has child waypoints, opening the cache descriptions indicates that there are multiple waypoints. but i neither get the coords of the child waypoints shown nor have i found a way to show these waypoints on the map.
how can this be done?
Title: Re: Weird interpretation of <url> within gpx file
Post by: stebu on December 01, 2011, 10:02:26
Quote from: "bongo"and an additional point
3)
if a geocache loaded from gpx has child waypoints, opening the cache descriptions indicates that there are multiple waypoints. but i neither get the coords of the child waypoints shown nor have i found a way to show these waypoints on the map.
how can this be done?
When the pop up for a cache tells you "Waypoints    n" (n>0)
Click on the "Cache box" (leftmost button)
In the new window click on the 2nd from left button (two points connected by two arrows).
That's it.
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on December 01, 2011, 16:34:13
thanks stebu ;)

bongo ...
1) support for external files directly in URL tag in GPX file was not supported ... till now
2) about problem with diacritics ... it have to be some issue with encoding of file. Is file displayed correctly in web browser? If so, send me it

new version will be released probably tomorrow. I have there some news that want to publish soon, so test it please then and let me know ...
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 01, 2011, 16:54:57
hi menion

1)
gpx 1.0 seems to use the url tag, while gpx 1.1 seems to do it using href. i added a snippet from gpx 1.0, but could also be done with 1.1.
i could send you both files so that you can tell me where to put the link to the external file.

2)
to what address can i send the file? in the browser, the file looks ok, but within locus i got all these chars replaced with the 'diamond?'.
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 02, 2011, 08:56:06
i've sent the files to your email!
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on December 05, 2011, 11:06:48
fine thanks, email received

I'm playing with this ... in locus is using (forcing) utf-8 encoding for external files. I was trying to leave this settings off and just load file, but without correctly set encoding in file, this don't work. So to do not broke already working solution, I'll leave system as is. This mean you have to have files encoded in utf-8. Example how I achieved this. Download notepad++ program. Install, open html file and from top menu select encoding > convert to UTF-8. That's all, now it should work correctly

with links in file ... there was simple problem as I discovered. They were loaded by locus, but never displayed. So fixed now ..
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 05, 2011, 15:50:33
ok, so i checked the link again with the lates version of locus:

line in the GPX file:
<url>file://sdcard/Locus/data/geocaching/2D/GC2DBB0.htm</url>

locus tries to open:
content://com.android.htmlfileprovider/ ... ?text/html (content://com.android.htmlfileprovider/Locus(data/geocaching/2D/GC2DBB0.htm?text/html)

with no success.

although there is a file:
sdcard/Locus/data/geocaching/2D/GC2DBB0.htm

on the flash.

so what am i still doing wrong?
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on December 05, 2011, 16:03:14
ach ... sentence "fixed now" do not mean that old version on market have this fixed .. you have to wait till next release
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 05, 2011, 16:09:35
yes, filename on andridpit is ...1.21...

isn't this the right place to find the latest version?
Title: Re: Weird interpretation of <url> within gpx file
Post by: gynta on December 05, 2011, 19:27:39
Quote from: "menion"...you have to wait till next release
Quote from: "bongo"isn't this the right place to find the latest version?
means you have to wait till next release  :roll:
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on December 07, 2011, 19:57:44
thanks gynta :)

you may test this feature in current testing version here viewtopic.php?f=25&t=1250 (http://forum.asamm.cz/viewtopic.php?f=25&t=1250)
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 08, 2011, 13:55:16
i loaded 1.14.6.2. to check this out. unfortunately, there seems to be a problem...still...
on the title page of the cache, i get the additional hotlink 'URL' named 'Datei: GC2DBB0.htm'.
this hotlink tries to open webpage: 'content://com.android.htmlfileprovider/locus/data/geocaching/2d/gc2dbb0.htm?text/html' but is not able to open it, although there is a file 'sdcard/locus/data/geocaching/2d/gc2dbb0.htm'.
dont' know what's wrong ;-(
what is the '?text/html' for? could this be the problem?
does 'content://com.android.htmlfileprovider/locus/data/...' really point to '/sdcard/locus/data/...' ?
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on December 08, 2011, 13:58:07
and what is the url you have in GPX file? Is it absolute path to file starting with "file://..."?
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 08, 2011, 14:00:46
the line in the gpx is:
<url>file://sdcard/Locus/data/geocaching/2D/GC2DBB0.htm</url>
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on December 08, 2011, 14:10:56
damn, this have to work, I've tested it ... sorry, I'll check it once again ...
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 08, 2011, 14:20:13
no problem ;-)
so for the moment, i went back to the former revision to find out why some of my raster maps are not found by locus (viewtopic.php?f=10&t=1390#p8242 (http://forum.asamm.cz/viewtopic.php?f=10&t=1390#p8242)), as i cannot check this with the beta version which does not load raster maps at all.
Title: Re: Weird interpretation of <url> within gpx file
Post by: Menion on December 08, 2011, 16:57:59
hmm this is weird. I'm testing it and it works for me well. In which web browser it's trying to open?
Title: Re: Weird interpretation of <url> within gpx file
Post by: bongo on December 08, 2011, 17:19:03
it says 'html viewer'. i have no further info on it. it seems to be built into cyanogenmod7.