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/core/src/base/ |
Upload File : |
import { EventEmitter } from 'main.core.events'; import { Location, LocationType, } from 'location.core'; /** * Base class for source maps */ export default class MapBase extends EventEmitter { constructor() { super(); this.setEventNamespace('BX.Location.Core.MapBase'); } render(props: Object): Promise { throw new Error('Must be implemented'); } set location(location: Location): void { throw new Error('Must be implemented'); } panTo(latitude: string, longitude: string): void { throw new Error('Must be implemented'); } set mode(mode: string): void { throw new Error('Must be implemented'); } set zoom(zoom: number): void { throw new Error('Must be implemented'); } static getZoomByLocation(location: ?Location): number { const defaultZoom = 18; if (!location) { return defaultZoom; } const locationType = location.type; if (locationType <= 0) { return defaultZoom; } if (locationType < LocationType.COUNTRY) { return 1; } else if (locationType === LocationType.COUNTRY) { return 4; } else if (locationType <= LocationType.ADM_LEVEL_1) { return 6; } else if (locationType <= LocationType.LOCALITY) { return 11; } else if (locationType <= LocationType.STREET) { return 16; } return defaultZoom; } onLocationChangedEventSubscribe(listener: function): void { throw new Error('Must be implemented'); } onMapShow() { } destroy() { } }