Current Path : /var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/location/osm/src/requesters/ |
Current File : /var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/location/osm/src/requesters/searchrequester.js |
import BaseRequester from './baserequester'; export default class SearchRequester extends BaseRequester { createUrl(params: { query: string, viewbox: string, limit: ?number }): string { const limit = params.limit ?? 5; let result = `${this.serviceUrl}/? action=osmgateway.location.search ¶ms[q]=${encodeURIComponent(params.query)} ¶ms[format]=json ¶ms[limit]=${limit} ¶ms[accept-language]=${this.sourceLanguageId}`; if (params.viewbox) { result += `¶ms[viewbox]=${params.viewbox}`; } return result; } }