commit 3d87d9413bc46894922b0a0924fd00ff220d4c2a
parent f87ffb2b028c88e109d45bc0e6167673bda41e7d
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 7 Dec 2024 23:02:59 +0100
search: restore mapy.cz
Diffstat:
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/lib/leaflet.control.search/index.js b/src/lib/leaflet.control.search/index.js
@@ -215,7 +215,7 @@ const SearchControl = L.Control.extend({
includes: L.Mixin.Events,
options: {
- provider: 'photon',
+ provider: 'mapycz',
providerOptions: {
maxResponses: 5,
},
diff --git a/src/lib/leaflet.control.search/providers/mapycz/index.js b/src/lib/leaflet.control.search/providers/mapycz/index.js
@@ -1,6 +1,6 @@
import L from 'leaflet';
-import config from '~/config';
+import urlViaCorsProxy from '~/lib/CORSProxy';
import * as logging from '~/lib/logging';
import {fetch} from '~/lib/xhr-promise';
@@ -14,7 +14,7 @@ const MapyCzProvider = BaseProvider.extend({
name: 'Mapy.cz',
options: {
- apiUrl: 'https://api.mapy.cz/v0/suggest/',
+ apiUrl: urlViaCorsProxy('https://pro.mapy.cz/suggest/'),
attribution: {
text: 'Mapy.cz',
url: 'https://mapy.cz',
@@ -32,7 +32,6 @@ const MapyCzProvider = BaseProvider.extend({
this.options.categoriesLanguages,
this.options.defaultLanguage
)[0];
- this.apiKey = config.mapyCz;
},
search: async function (query, {latlng, zoom}) {
@@ -48,7 +47,6 @@ const MapyCzProvider = BaseProvider.extend({
if (this.options.maxResponses) {
url.searchParams.append('count', this.options.maxResponses);
}
- url.searchParams.append('apikey', this.apiKey);
let xhr;
try {
xhr = await fetch(url.href, {responseType: 'json', timeout: 5000});