diff --git a/_tourism/Syberia/ergaki_2017.zmp/18.bmp b/_tourism/Syberia/ergaki_2017.zmp/18.bmp new file mode 100644 index 00000000..47d65f27 Binary files /dev/null and b/_tourism/Syberia/ergaki_2017.zmp/18.bmp differ diff --git a/_tourism/Syberia/ergaki_2017.zmp/24.bmp b/_tourism/Syberia/ergaki_2017.zmp/24.bmp new file mode 100644 index 00000000..595f438b Binary files /dev/null and b/_tourism/Syberia/ergaki_2017.zmp/24.bmp differ diff --git a/_tourism/Syberia/ergaki_2017.zmp/GetUrlScript.txt b/_tourism/Syberia/ergaki_2017.zmp/GetUrlScript.txt new file mode 100644 index 00000000..96d73132 --- /dev/null +++ b/_tourism/Syberia/ergaki_2017.zmp/GetUrlScript.txt @@ -0,0 +1,57 @@ +function GetCode(const url: AnsiString): Cardinal; +var + VResponseCode: Cardinal; + VResponseHeader, VResponseData: AnsiString; +begin + Result := 1; + if Assigned(Downloader) then begin + VResponseHeader := ''; + VResponseData := ''; + VResponseCode := Downloader.DoHttpRequest(url, '', '', VResponseHeader, VResponseData); + Result := VResponseCode; + end; +end; + +var + BaseUrl: string; + code: Cardinal; + z_ok, z_no: integer; + r: integer; +begin + ResultURL := ''; + z_ok := StrToIntDef(GetBefore(';', ScriptBuffer), 1); // Максимальный масштаб, который точно есть + z_no := StrToIntDef(GetAfter(';', ScriptBuffer), 25); // Минимальный масштаб, которого точно нет + + // Масштаба нет - говорить не о чем + if getz >= z_no then exit; + + // Выбор зеркала, если не указана версия + if version = '' then + r := random(2) + else + r := StrToInt(version); + + case r of + 0: BaseUrl := GetURLBase; + 1: BaseUrl := RegExprReplaceMatchSubStr(GetURLBase, 'http://91.237.82.95:8088', 'https://maps.melda.ru'); + end; + + // Проверяем наличие масштаба + if getz > z_ok then begin + code := GetCode(BaseUrl+inttostr(getz)+'/'); + + // Внимание! Если сервер вернёт 403 - code почему-то будет 0. Так что выбор "404 или что-то иное" + // Если дело дошло до проверки наличия масштаба - значит какая-то граница (z_ok / z_no) точно подвинется. + if code = 404 then z_no := getz else z_ok := getz; + + // Сохраняем актуализированные границы для последующих вызовов + ScriptBuffer := inttostr(z_ok) + ';' + inttostr(z_no); + + // Масштаба нет (о чём могли только что при проверке узнать) - говорить не о чем + if getz >= z_no then exit; + end; + + // Ок, качаем тайлик + ResultURL:= BaseUrl+inttostr(getz-1)+'/'+inttostr(getx)+'/'+inttostr(gety )+'.jpg'; + +end. diff --git a/_tourism/Syberia/ergaki_2017.zmp/info.txt b/_tourism/Syberia/ergaki_2017.zmp/info.txt new file mode 100644 index 00000000..46881978 --- /dev/null +++ b/_tourism/Syberia/ergaki_2017.zmp/info.txt @@ -0,0 +1,10 @@ +(c)
+sergey_shandl@mail.ru
+ +
+
: https://cloud.mail.ru/public/3nm6/3jz6ZbCoF/ + + +
+ - garl@mail.ru
+
diff --git a/_tourism/Syberia/ergaki_2017.zmp/params.txt b/_tourism/Syberia/ergaki_2017.zmp/params.txt new file mode 100644 index 00000000..3bdbd64e --- /dev/null +++ b/_tourism/Syberia/ergaki_2017.zmp/params.txt @@ -0,0 +1,24 @@ + +[PARAMS] +pnum=17 +GUID={a93253a7-d413-4fec-9322-d62ba8ba0df6} +ParentSubMenu_ru=Туристические\Россия\Сибирь +ParentSubMenu_uk=Туристичний\Росія\Сибір +ParentSubMenu=Hike\Russia\Siberia + +name_ru=Ергаки 2017 +name_uk=Sayan mountains. Ergaki 2017 +name=Sayan mountains. Ergaki 2017 +DefURLBase=http://91.237.82.95:8088/pub/tourism/ergaki-2017/ + +projection=1 +sradiusa=6378137 +sradiusb=6378137 + +NameInCache=ergaki-2017 +Ext=.jpg +defaultContentType=image/jpeg +ContentType="image/jpeg" +MaxConnectToServerCount=1 +License=(c) Киселёв Д.В. Ширнин В.В. +IsUseDownloaderInScript=1