"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); /*! * devextreme-angular * Version: 19.1.16 * Build date: Tue Oct 18 2022 * * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-angular */ Object.defineProperty(exports, "__esModule", { value: true }); var platform_browser_1 = require("@angular/platform-browser"); var platform_browser_2 = require("@angular/platform-browser"); var core_1 = require("@angular/core"); var map_1 = require("devextreme/ui/map"); var component_1 = require("../core/component"); var template_host_1 = require("../core/template-host"); var integration_1 = require("../core/integration"); var template_1 = require("../core/template"); var nested_option_1 = require("../core/nested-option"); var watcher_helper_1 = require("../core/watcher-helper"); var iterable_differ_helper_1 = require("../core/iterable-differ-helper"); var center_dxi_1 = require("./nested/center-dxi"); var key_1 = require("./nested/key"); var marker_dxi_1 = require("./nested/marker-dxi"); var location_dxi_1 = require("./nested/location-dxi"); var tooltip_1 = require("./nested/tooltip"); var route_dxi_1 = require("./nested/route-dxi"); var center_dxi_2 = require("./nested/center-dxi"); var marker_dxi_2 = require("./nested/marker-dxi"); var route_dxi_2 = require("./nested/route-dxi"); /** * The Map is an interactive widget that displays a geographic map with markers and routes. */ var DxMapComponent = (function (_super) { __extends(DxMapComponent, _super); function DxMapComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) { var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this; _this._watcherHelper = _watcherHelper; _this._idh = _idh; _this._createEventEmitters([ { subscribe: 'click', emit: 'onClick' }, { subscribe: 'disposing', emit: 'onDisposing' }, { subscribe: 'initialized', emit: 'onInitialized' }, { subscribe: 'markerAdded', emit: 'onMarkerAdded' }, { subscribe: 'markerRemoved', emit: 'onMarkerRemoved' }, { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'ready', emit: 'onReady' }, { subscribe: 'routeAdded', emit: 'onRouteAdded' }, { subscribe: 'routeRemoved', emit: 'onRouteRemoved' }, { emit: 'accessKeyChange' }, { emit: 'activeStateEnabledChange' }, { emit: 'autoAdjustChange' }, { emit: 'centerChange' }, { emit: 'controlsChange' }, { emit: 'disabledChange' }, { emit: 'elementAttrChange' }, { emit: 'focusStateEnabledChange' }, { emit: 'heightChange' }, { emit: 'hintChange' }, { emit: 'hoverStateEnabledChange' }, { emit: 'keyChange' }, { emit: 'markerIconSrcChange' }, { emit: 'markersChange' }, { emit: 'providerChange' }, { emit: 'routesChange' }, { emit: 'rtlEnabledChange' }, { emit: 'tabIndexChange' }, { emit: 'typeChange' }, { emit: 'visibleChange' }, { emit: 'widthChange' }, { emit: 'zoomChange' } ]); _this._idh.setHost(_this); optionHost.setHost(_this); return _this; } Object.defineProperty(DxMapComponent.prototype, "accessKey", { get: /** * Specifies the shortcut key that sets focus on the widget. */ function () { return this._getOption('accessKey'); }, set: function (value) { this._setOption('accessKey', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "activeStateEnabled", { get: /** * Specifies whether or not the widget changes its state when interacting with a user. */ function () { return this._getOption('activeStateEnabled'); }, set: function (value) { this._setOption('activeStateEnabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "autoAdjust", { get: /** * Specifies whether the widget automatically adjusts center and zoom option values when adding a new marker or route, or if a new widget contains markers or routes by default. */ function () { return this._getOption('autoAdjust'); }, set: function (value) { this._setOption('autoAdjust', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "center", { get: /** * An object, a string, or an array specifying which part of the map is displayed at the widget's center using coordinates. The widget can change this value if autoAdjust is enabled. */ function () { return this._getOption('center'); }, set: function (value) { this._setOption('center', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "controls", { get: /** * Specifies whether or not map widget controls are available. */ function () { return this._getOption('controls'); }, set: function (value) { this._setOption('controls', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "disabled", { get: /** * Specifies whether the widget responds to user interaction. */ function () { return this._getOption('disabled'); }, set: function (value) { this._setOption('disabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "elementAttr", { get: /** * Specifies the attributes to be attached to the widget's root element. */ function () { return this._getOption('elementAttr'); }, set: function (value) { this._setOption('elementAttr', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "focusStateEnabled", { get: /** * Specifies whether the widget can be focused using keyboard navigation. */ function () { return this._getOption('focusStateEnabled'); }, set: function (value) { this._setOption('focusStateEnabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "height", { get: /** * Specifies the widget's height. */ function () { return this._getOption('height'); }, set: function (value) { this._setOption('height', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "hint", { get: /** * Specifies text for a hint that appears when a user pauses on the widget. */ function () { return this._getOption('hint'); }, set: function (value) { this._setOption('hint', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "hoverStateEnabled", { get: /** * Specifies whether the widget changes its state when a user pauses on it. */ function () { return this._getOption('hoverStateEnabled'); }, set: function (value) { this._setOption('hoverStateEnabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "key", { get: /** * A key used to authenticate the application within the required map provider. */ function () { return this._getOption('key'); }, set: function (value) { this._setOption('key', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "markerIconSrc", { get: /** * A URL pointing to the custom icon to be used for map markers. */ function () { return this._getOption('markerIconSrc'); }, set: function (value) { this._setOption('markerIconSrc', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "markers", { get: /** * An array of markers displayed on a map. */ function () { return this._getOption('markers'); }, set: function (value) { this._setOption('markers', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "provider", { get: /** * The name of the current map data provider. */ function () { return this._getOption('provider'); }, set: function (value) { this._setOption('provider', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "routes", { get: /** * An array of routes shown on the map. */ function () { return this._getOption('routes'); }, set: function (value) { this._setOption('routes', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "rtlEnabled", { get: /** * Switches the widget to a right-to-left representation. */ function () { return this._getOption('rtlEnabled'); }, set: function (value) { this._setOption('rtlEnabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "tabIndex", { get: /** * Specifies the number of the element when the Tab key is used for navigating. */ function () { return this._getOption('tabIndex'); }, set: function (value) { this._setOption('tabIndex', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "type", { get: /** * The type of a map to display. */ function () { return this._getOption('type'); }, set: function (value) { this._setOption('type', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "visible", { get: /** * Specifies whether the widget is visible. */ function () { return this._getOption('visible'); }, set: function (value) { this._setOption('visible', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "width", { get: /** * Specifies the widget's width. */ function () { return this._getOption('width'); }, set: function (value) { this._setOption('width', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "zoom", { get: /** * The map's zoom level. The widget can change this value if autoAdjust is enabled. */ function () { return this._getOption('zoom'); }, set: function (value) { this._setOption('zoom', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "centerChildren", { get: function () { return this._getOption('center'); }, set: function (value) { this.setChildren('center', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "markersChildren", { get: function () { return this._getOption('markers'); }, set: function (value) { this.setChildren('markers', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxMapComponent.prototype, "routesChildren", { get: function () { return this._getOption('routes'); }, set: function (value) { this.setChildren('routes', value); }, enumerable: true, configurable: true }); DxMapComponent.prototype._createInstance = function (element, options) { return new map_1.default(element, options); }; DxMapComponent.prototype.ngOnDestroy = function () { this._destroyWidget(); }; DxMapComponent.prototype.ngOnChanges = function (changes) { _super.prototype.ngOnChanges.call(this, changes); this.setupChanges('center', changes); this.setupChanges('markers', changes); this.setupChanges('routes', changes); }; DxMapComponent.prototype.setupChanges = function (prop, changes) { if (!(prop in this._optionsToUpdate)) { this._idh.setup(prop, changes); } }; DxMapComponent.prototype.ngDoCheck = function () { this._idh.doCheck('center'); this._idh.doCheck('markers'); this._idh.doCheck('routes'); this._watcherHelper.checkWatchers(); _super.prototype.ngDoCheck.call(this); _super.prototype.clearChangedOptions.call(this); }; DxMapComponent.prototype._setOption = function (name, value) { var isSetup = this._idh.setupSingle(name, value); var isChanged = this._idh.getChanges(name, value) !== null; if (isSetup || isChanged) { _super.prototype._setOption.call(this, name, value); } }; DxMapComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'dx-map', template: '', providers: [ template_host_1.DxTemplateHost, watcher_helper_1.WatcherHelper, nested_option_1.NestedOptionHost, iterable_differ_helper_1.IterableDifferHelper ] },] }, ]; /** @nocollapse */ DxMapComponent.ctorParameters = function () { return [ { type: core_1.ElementRef, }, { type: core_1.NgZone, }, { type: template_host_1.DxTemplateHost, }, { type: watcher_helper_1.WatcherHelper, }, { type: iterable_differ_helper_1.IterableDifferHelper, }, { type: nested_option_1.NestedOptionHost, }, { type: platform_browser_2.TransferState, }, { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] }, ]; }; DxMapComponent.propDecorators = { "accessKey": [{ type: core_1.Input },], "activeStateEnabled": [{ type: core_1.Input },], "autoAdjust": [{ type: core_1.Input },], "center": [{ type: core_1.Input },], "controls": [{ type: core_1.Input },], "disabled": [{ type: core_1.Input },], "elementAttr": [{ type: core_1.Input },], "focusStateEnabled": [{ type: core_1.Input },], "height": [{ type: core_1.Input },], "hint": [{ type: core_1.Input },], "hoverStateEnabled": [{ type: core_1.Input },], "key": [{ type: core_1.Input },], "markerIconSrc": [{ type: core_1.Input },], "markers": [{ type: core_1.Input },], "provider": [{ type: core_1.Input },], "routes": [{ type: core_1.Input },], "rtlEnabled": [{ type: core_1.Input },], "tabIndex": [{ type: core_1.Input },], "type": [{ type: core_1.Input },], "visible": [{ type: core_1.Input },], "width": [{ type: core_1.Input },], "zoom": [{ type: core_1.Input },], "onClick": [{ type: core_1.Output },], "onDisposing": [{ type: core_1.Output },], "onInitialized": [{ type: core_1.Output },], "onMarkerAdded": [{ type: core_1.Output },], "onMarkerRemoved": [{ type: core_1.Output },], "onOptionChanged": [{ type: core_1.Output },], "onReady": [{ type: core_1.Output },], "onRouteAdded": [{ type: core_1.Output },], "onRouteRemoved": [{ type: core_1.Output },], "accessKeyChange": [{ type: core_1.Output },], "activeStateEnabledChange": [{ type: core_1.Output },], "autoAdjustChange": [{ type: core_1.Output },], "centerChange": [{ type: core_1.Output },], "controlsChange": [{ type: core_1.Output },], "disabledChange": [{ type: core_1.Output },], "elementAttrChange": [{ type: core_1.Output },], "focusStateEnabledChange": [{ type: core_1.Output },], "heightChange": [{ type: core_1.Output },], "hintChange": [{ type: core_1.Output },], "hoverStateEnabledChange": [{ type: core_1.Output },], "keyChange": [{ type: core_1.Output },], "markerIconSrcChange": [{ type: core_1.Output },], "markersChange": [{ type: core_1.Output },], "providerChange": [{ type: core_1.Output },], "routesChange": [{ type: core_1.Output },], "rtlEnabledChange": [{ type: core_1.Output },], "tabIndexChange": [{ type: core_1.Output },], "typeChange": [{ type: core_1.Output },], "visibleChange": [{ type: core_1.Output },], "widthChange": [{ type: core_1.Output },], "zoomChange": [{ type: core_1.Output },], "centerChildren": [{ type: core_1.ContentChildren, args: [center_dxi_2.DxiCenterComponent,] },], "markersChildren": [{ type: core_1.ContentChildren, args: [marker_dxi_2.DxiMarkerComponent,] },], "routesChildren": [{ type: core_1.ContentChildren, args: [route_dxi_2.DxiRouteComponent,] },], }; return DxMapComponent; }(component_1.DxComponent)); exports.DxMapComponent = DxMapComponent; var DxMapModule = (function () { function DxMapModule() { } DxMapModule.decorators = [ { type: core_1.NgModule, args: [{ imports: [ center_dxi_1.DxiCenterModule, key_1.DxoKeyModule, marker_dxi_1.DxiMarkerModule, location_dxi_1.DxiLocationModule, tooltip_1.DxoTooltipModule, route_dxi_1.DxiRouteModule, integration_1.DxIntegrationModule, template_1.DxTemplateModule, platform_browser_1.BrowserTransferStateModule ], declarations: [ DxMapComponent ], exports: [ DxMapComponent, center_dxi_1.DxiCenterModule, key_1.DxoKeyModule, marker_dxi_1.DxiMarkerModule, location_dxi_1.DxiLocationModule, tooltip_1.DxoTooltipModule, route_dxi_1.DxiRouteModule, template_1.DxTemplateModule ] },] }, ]; return DxMapModule; }()); exports.DxMapModule = DxMapModule; //# sourceMappingURL=map.js.map