Locus Map - forum

Content & Tools => Maps => Topic started by: kavetheman on February 03, 2024, 11:24:52

Title: Problem with online map source
Post by: kavetheman on February 03, 2024, 11:24:52
I am trying to add an online mapsource. The map displays its tiles not in order. What can be wrong?
(https://photos.smugmug.com/photos/i-SXT3fm8/0/8086ac52/X3/i-SXT3fm8-X3.jpg)
Title: Re: Problem with online map source
Post by: michaelbechtold on February 03, 2024, 13:49:45
The URL string has to have x/y (lon/lat) included. Are they in the right place (order)?
Title: Re: Problem with online map source
Post by: kavetheman on February 03, 2024, 13:55:17
If I remember correctly this is what is in the providers file:

<provider id="10921" type="1" visible="true" background="-1">
<name>Hitta Friluft</name>
<mode>Classic</mode>
<countries>Sweden</countries>

<url><![CDATA[http://static.hitta.se/tile/v3/4_2x/{z}/{x}/{y}]]></url>
<zoomPart>{z}-8</zoomPart>
<zoomMin>12</zoomMin>
<zoomMax>25</zoomMax>
<tileSize>256</tileSize>
<attribution><![CDATA[© Karttakeskus. Lantmäteriet/Metria]]></attribution>
<extraHeader><![CDATA[Referer#http://kartor.eniro.se/]]></extraHeader>
<extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0]]></extraHeader>
<usage>road,city</usage>
</provider>
Title: Re: Problem with online map source
Post by: kavetheman on February 03, 2024, 13:56:48
This is what works in Guru maps for the same map source:
<?xml version="1.0" encoding="UTF-8"?>
<customMapSource>
<name>Hitta Frilufts</name>
<url>http://static.hitta.se/tile/v3/4_2x/{$z}/{$x}/{$invY}</url>
</customMapSource>
Title: Re: Problem with online map source
Post by: kavetheman on February 03, 2024, 14:00:50
Quote from: michaelbechtold on February 03, 2024, 13:49:45The URL string has to have x/y (lon/lat) included. Are they in the right place (order)?
In Guru maps we use invY, inverted Y. Is it possible with Locus?
Title: Re: Problem with online map source
Post by: michaelbechtold on February 03, 2024, 17:42:13
Seems so:
https://docs.locusmap.eu/doku.php?id=manual:advanced:customization:online_maps
Title: Re: Problem with online map source
Post by: kavetheman on February 03, 2024, 23:01:46
Perfect. However I cant make it work woth any of the modes.

Here is my provider:
<provider id="10921" type="1" visible="true" background="-1">
<name>Hitta Friluft</name>
<mode>Classic</mode>
<countries>Sweden</countries>

<url><![CDATA[http://static.hitta.se/tile/v3/4_2x/{z}/{x}/{y}]]></url>
<zoomPart>{z}-8</zoomPart>
<zoomMin>12</zoomMin>
<zoomMax>25</zoomMax>
<tileSize>256</tileSize>
<attribution><![CDATA[© Karttakeskus. Lantmäteriet/Metria]]></attribution>
<extraHeader><![CDATA[Referer#http://kartor.eniro.se/]]></extraHeader>
<extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0]]></extraHeader>
<usage>road,city</usage>
</provider>
Title: Re: Problem with online map source
Post by: Menion on February 05, 2024, 08:23:01
Hmm seems to be a little too complicated. It is because of 512x512 tiles used in the common 256x256 system.

Give this a try:

<provider id="10921" type="1" visible="true" background="-1">
<name>Hitta Friluft</name>
<mode>Classic</mode>
<countries>Sweden</countries>

<url><![CDATA[http://static.hitta.se/tile/v3/4_{ts}/{z}/{x}/{y}]]></url>
<zoomPart>{z}-8</zoomPart>
<zoomMin>12</zoomMin>
<zoomMax>25</zoomMax>
<tileSize>256</tileSize>
<tileScale dpi="0" multi="2.0" replace="2x" />
<attribution><![CDATA[© Karttakeskus. Lantmäteriet/Metria]]></attribution>
<extraHeader><![CDATA[Referer#http://kartor.eniro.se/]]></extraHeader>
<extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0]]></extraHeader>
<usage>road,city</usage>
</provider>