This object is in archive! 

POI with link to local store: CSS and images not displayed

Frederic shared this question 5 years ago
Answered

Hello,

- I create a POI

- I add a link (URL) to an HTML page stored in the local store (file:///mnt/sdcard/...)

- The HTML page uses a CSS and images contained in the same folder (relative URL's)

- I click on the link and select whatever browser or viewer

- The HTML page displays (with a URL starting with content;//com.asamm.locus.pro.provider/app_external_files/...), however, the CSS and images are not loaded.

Am I doing something wrong?

Replies (3)

photo
1

Hi Frederic,

Locus Map point description is not built for adding a link to local HTML containing CSS and images. You can add simple text, an external URL or a separate image(s) (and other media) only .

best regards

Michal, Locus team

photo
1

Hello,

I am using the <link> tag, not the <desc> tag. So it would look like:

<wpt lat="10" lon="5">

<time>2019-08-05T12:29:30.798Z</time>

<name>Example</name>

<desc><![CDATA[Example with a link]]></desc>

<link href="file:///mnt/sdcard/test/example.htm"></link>

</wpt>

Clicking the link would launch the browser with the following URL:

content://com.asamm.locus.pro.provider/app_external_files/test/example.htm

The file example.htm contains an image tag that looks like:

<img src="example.jpg" />

The problem is that the following URL returns a page not found error:

content://com.asamm.locus.pro.provider/app_external_files/test/example.jpg

This means that having a GPX file containing a <link> to a JPG file would not open in the browser (i.e. 404).

So should I conclude that the <link> tag can only be used to point to external URL's that can contain CSS, images and whatever fancy features but, for locally hosted files, can only point to HTML pages containing nothing but text ?

Contrarily to what you announce, it would not work to point to a locally hosted image or text file when using the browser to open it.

photo
1

Good day Frederic,

since Android 8, applications can't share files directly. They have to use special so-called "file provider" system build-in Android itself that send the special ID of file applications wants to share. Like in this case Locus Map: content://com.asamm.locus.pro.provider/app_external_files/test/example.htm .

The only solution here should be to open mentioned file directly in Locus Map internal web browser, but because you are the first who wants to include into links local file, I have to refuse it. Thanks for understanding.

Menion

Replies have been locked on this page!