Page 1 of 1

[resolved] mapy.cz

Posted: Sun Nov 02, 2014 9:14 am
by MacMurphy
Hi,

Would it be possible to include into offer of maps http://www.mapy.cz, mainly touristic/cycling part?

Thanks.

MM

Re: mapy.cz

Posted: Sun Nov 02, 2014 5:31 pm
by Psyberia-Support
Hi,
I've just looked at these maps, which are very nice! Unfortunately they do not use a standard projection and tiling scheme, so without any more information I won't be able to add them in the application. At least the used projection would be a nice clue, but everything in the website is in Czech and I don't understand it...
If you have any info please let me know.
Best regards

Re: mapy.cz

Posted: Tue Jan 31, 2023 9:59 am
by damiano.falcioni
Hi,
I resume this old post as the mapy.cz maps (especially the touristic) are really good in my opinion.
The mapy.cz format is (touristic map): mapserver.mapy.cz/turist-en/%z-%x-%y

As a sample, the following mapy.cz tile correspond to the following openstreetmap tile:
- mapserver.mapy.cz/turist-en/16-35739-22707
- a.tile.openstreetmap.org/16/35739/22707.png

Best regards,
Damiano

Re: mapy.cz

Posted: Tue Feb 07, 2023 10:01 pm
by damiano.falcioni
I'm trying to create the AQX for mapy, from their public APIs sample (https://api.mapy.cz/view?page=simple).
Till now this is the current status:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<aqx version="11">
  <name>Mapy.cz</name>
  <description>© Seznam.cz, a.s.</description>
  <param name="apiKey">virtual-0fcd17d444befc9b4fa678d506bafc5b</param>  
  <source id="MAPYCZ" type="topo">
    <name>Touristic</name>
    <data-source><![CDATA[https://mapy.cz/]]></data-source>
		<copyright>© Seznam.cz, a.s.</copyright>
    <zoom-levels z="1-17">
      <expression set="date0" type="long">unixtime()</expression>
      <expression set="date1" type="long">data0 - toLong(format("%tS",data0)) - (toLong(format("%tM",data0))*60) - (toLong(format("%%tH",data0))*60*60) + 1</expression>
      <expression set="date">toString(date1)</expression>      
      <expression set="sdk">format("%c", 'm'^'s')</expression>
      <expression set="sdk">sdk + format("%c", 'a'^'d')</expression>
      <expression set="sdk">sdk + format("%c", 'p'^'k')</expression>
      <expression set="sdk">sdk + format("%c", 'y'^'s')</expression>
      <expression set="sdk">sdk + format("%c", 'a'^'d')</expression>
      <expression set="sdk">sdk + format("%c", 'p'^'k')</expression>
      <expression set="sdk">sdk + format("%c", 'i'^'s')</expression>
      <expression set="sdk">sdk + format("%c", ','^'d')</expression>
      <expression set="sdk">sdk + format("%c", 'A'^'k')</expression>
      <expression set="sdk">sdk + format("%c", 'r'^'s')</expression>
      <expression set="sdk">sdk + format("%c", 'm'^'d')</expression>
      <expression set="sdk">sdk + format("%c", 's'^'k')</expression>
      <expression set="sdk">sdk + format("%c", 't'^'s')</expression>
      <expression set="sdk">sdk + format("%c", 'r'^'d')</expression>
      <expression set="sdk">sdk + format("%c", 'o'^'k')</expression>
      <expression set="sdk">sdk + format("%c", 'n'^'s')</expression>
      <expression set="sdk">sdk + format("%c", 'g'^'d')</expression>
      <expression set="sdk">sdk + format("%c", ','^'k')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 0)^'s')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 1)^'d')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 2)^'k')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 3)^'s')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 4)^'d')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 5)^'k')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 6)^'s')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 7)^'d')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 8)^'k')</expression>
      <expression set="sdk">sdk + format("%c", charAt(date, 9)^'s')</expression>
      
      <expression set="sdk">base64(sdk)</expression>
      <tiles-size>256</tiles-size>
      <referer><![CDATA[https://fiddle.jshell.net/]]></referer>
      <server><![CDATA[https://api.mapy.cz/v1/maptiles/outdoor/256/{$z}/{$x}/{$y}?sdk={$sdk}&apikey={$param:apiKey}]]></server>
    </zoom-levels>
  </source>
</aqx>
The sdk url param is generated by this JS function that I tried to translate in AQX expressions:

Code: Select all

function() {
  var SDK_api="mapyapi";
  var SDK_version="Armstrong";
  var SDK_key="sdk";
  var date = new Date;
  date.setHours(0);
  date.setMinutes(0);
  date.setSeconds(1);
  date.setMilliseconds(0);
  var data = [SDK_api, SDK_version, date / 1e3 >>> 0].join(",");
  var xor_hodnota = [];
  for (var i = 0, max = data.length, keyMax = SDK_key.length, ptr = 0; i < max; i++) {
      var znakDat = data[i].charCodeAt(0);
      var znakKlice = SDK_key[ptr].charCodeAt(0);
      xor_hodnota.push(String.fromCharCode(znakDat ^ znakKlice));
      ptr++;
      if (ptr == keyMax) {
          ptr = 0
      }
  }
  return btoa(xor_hodnota.join(""));
};
I know that the base64 function will be added in future beta, but I'm trying to figure out if something else may be missing.
As a sample, to replace the JS ^ bitwise XOR operator can I use the AQX ^ operator like in Java ?
Also, in the server url the sdk param have to be urlencoded (js encodeURIComponent function). Could this create problems?
Thanks,
Damiano

Re: mapy.cz

Posted: Wed Feb 08, 2023 2:32 pm
by Psyberia-Support
Hi again,
The new beta version is now available and is called 2.3.4.r8118.
Functions "b64_enc()" and "b64_dec()" are now available.
Unfortunately there is no bitwise operation available. The "^" operator is actually the "power" function.
I can also try to add this, but you'll have to wait... again...

Re: mapy.cz

Posted: Wed Feb 08, 2023 4:44 pm
by damiano.falcioni
Sorry, it was my fault to do not have checked this previously.
Let me know if you manage to add this operator in future betas.
Thanks for all the effort,
Damiano

Re: mapy.cz

Posted: Fri Feb 10, 2023 9:42 pm
by Psyberia-Support
Hi again,
I'll add those function in the next beta.
By the way, the mapy.cz maps are already available in the app under the name "Czech Topo Maps".

Re: mapy.cz

Posted: Mon Feb 13, 2023 11:51 am
by damiano.falcioni
Many thanks!
This was funny actually.. I started this AQX from the official APIs as the endpoint I posted on the 31/01/2023, mapserver.mapy.cz (that I realized now, is the one used in the "Czech Topo Maps") started to gave me 401 unauthorized access when accessed in incognito mode or without cookies set by en.mapy.cz , but now is not the case anymore...really strange...but good to know that was already there and working :)
Thanks again for the effort.
Damiano

Re: mapy.cz

Posted: Mon Feb 13, 2023 5:01 pm
by Psyberia-Support
Ok great if it's working now.

Re: [resolved] mapy.cz

Posted: Fri Aug 11, 2023 4:58 am
by martin
Hi,

I am not sure if I am missing something, but I do not see 'Czech Tooo Maps' among community maps.

I am using AlpineQuest Off-Road Explorer 2.3.5b
and I can only see 'Czech Republic Freemap.sk Topo'
and 'Czech Republic OpenTopoMap.ru' options in the list of available Community maps.
Am I looking at a wrong place?
Thanks for any advice.

Martin

Re: [resolved] mapy.cz

Posted: Fri Aug 11, 2023 7:15 am
by Psyberia-Support
Unfortunately they have been removed 6 months ago following a request from mapy.