Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/location/google/src/ |
Upload File : |
import {Type} from 'main.core'; import {BaseSource, SourceCreationError} from 'location.core'; import Loader from './loader'; import AutocompleteService from './autocompleteservice'; import Map from './map'; import MapMobile from './mapmobile'; import PhotoService from './photoservice'; import GeocodingService from './geocodingservice'; export class Google extends BaseSource { static code = 'GOOGLE'; #languageId = ''; #sourceLanguageId = ''; #loaderPromise = null; #map; #mapMobile; #photoService; #geocodingService; #autocompleteService; constructor(props: Object) { super(props); if (!Type.isString(props.languageId) || props.languageId.trim() === '') { throw new SourceCreationError('props.languageId must be a string'); } this.#languageId = props.languageId; if (!Type.isString(props.sourceLanguageId) || props.sourceLanguageId.trim() === '') { throw new SourceCreationError('props.sourceLanguageId must be a string'); } this.#sourceLanguageId = props.sourceLanguageId; if (!Type.isString(props.apiKey) || props.apiKey.trim() === '') { throw new SourceCreationError('props.apiKey must be a string'); } this.#loaderPromise = Loader.load(props.apiKey, props.sourceLanguageId); this.#map = new Map({ googleSource: this, languageId: this.#languageId, }); this.#mapMobile = new MapMobile({ googleSource: this, languageId: this.#languageId, }); this.#autocompleteService = new AutocompleteService({ googleSource: this, languageId: this.#languageId }); this.#photoService = new PhotoService({ googleSource: this, map: this.#map }); this.#geocodingService = new GeocodingService({ googleSource: this, map: this.#map }); } get sourceCode(): string { return Google.code; } get loaderPromise(): Promise { return this.#loaderPromise; } get map() { return this.#map; } get mapMobile() { return this.#mapMobile; } get autocompleteService() { return this.#autocompleteService; } get photoService() { return this.#photoService; } get geocodingService() { return this.#geocodingService; } get languageId() { return this.#languageId; } }