all files / lib/ tile-layer.directive.js

96.32% Statements 288/299
65.71% Branches 46/70
97.56% Functions 80/82
97.6% Lines 285/292
2 statements, 1 branch Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009            47× 47×   47×   71×                                                                                                                                 97×     97×           97×           97×             97×             97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97×           97× 97× 97×   97× 99×   97×   97×   97×   97×   97×   97×   97×   97×   97×   97×   97×   97×   97×   97×   97× 57×   97× 63×   97×   97×   97×   97×                           10×                                                                                                                       10× 10×         20× 20×                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    Eif (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    Eif (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var leaflet_1 = require("leaflet");
var consts_1 = require("./consts");
var layer_group_provider_1 = require("./layer-group.provider");
var layer_provider_1 = require("./layer.provider");
/**
 * Angular2 directive for Leaflet tile-layers.
 *
 * *You can use this directive in an Angular2 template after importing `YagaModule`.*
 *
 * How to use in a template:
 * ```html
 * <yaga-map>
 *     <yaga-tile-layer
 *         [(url)]="..."
 *         [(display)]="..."
 *         [(opacity)]="..."
 *         [(zIndex)]="..."
 *
 *         (add)="..."
 *         (remove)="..."
 *         (popupopen)="..."
 *         (popupclose)="..."
 *         (tooltipopen)="..."
 *         (tooltipclose)="..."
 *         (click)="..."
 *         (dblclick)="..."
 *         (mousedown)="..."
 *         (mouseover)="..."
 *         (mouseout)="..."
 *         (contextmenu)="..."
 *         (loading)="..."
 *         (tileunload)="..."
 *         (tileloadstart)="..."
 *         (tileerror)="..."
 *         (tileload)="..."
 *         (load)="..."
 *
 *         [tileSize]="..."
 *         [updateWhenIdle]="..."
 *         [updateWhenZooming]="..."
 *         [updateInterval]="..."
 *         [bounds]="..."
 *         [noWrap]="..."
 *         [className]="..."
 *         [keepBuffer]="..."
 *         [maxZoom]="..."
 *         [minZoom]="..."
 *         [maxNativeZoom]="..."
 *         [minNativeZoom]="..."
 *         [subdomains]="..."
 *         [errorTileUrl]="..."
 *         [zoomOffset]="..."
 *         [tms]="..."
 *         [zoomReverse]="..."
 *         [detectRetina]="..."
 *         [crossOrigin]="..."
 *         [attribution]="...">
 *     </yaga-tile-layer>
 * </yaga-map>
 * ```
 *
 * @link http://leafletjs.com/reference-1.2.0.html#tilelayer Original Leaflet documentation
 * @link https://leaflet-ng2.yagajs.org/1.0.0/browser-test?grep=Tile-Layer%20Directive Unit-Test
 * @link https://leaflet-ng2.yagajs.org/1.0.0/coverage/lcov-report/lib/tile-layer.directive.js.html Test coverage
 * @link https://leaflet-ng2.yagajs.org/1.0.0/typedoc/classes/tilelayerdirective.html API documentation
 * @example https://leaflet-ng2.yagajs.org/1.0.0/examples/tile-layer-directive
 */
var TileLayerDirective = /** @class */ (function (_super) {
    __extends(TileLayerDirective, _super);
    function TileLayerDirective(layerGroupProvider, layerProvider) {
        var _this = 
        // Transparent 1px image:
        _super.call(this, consts_1.TRANSPARENT_PIXEL, { errorTileUrl: consts_1.TRANSPARENT_PIXEL }) || this;
        _this.layerGroupProvider = layerGroupProvider;
        /**
         * Two-Way bound property for the URL.
         * Use it with `<yaga-tile-layer [(url)]="someValue">` or `<yaga-tile-layer (urlChange)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-seturl Original Leaflet documentation
         */
        _this.urlChange = new core_1.EventEmitter();
        /**
         * Two-Way bound property for the display status of the layer.
         * Use it with `<yaga-tile-layer [(display)]="someValue">`
         * or `<yaga-tile-layer (displayChange)="processEvent($event)">`
         */
        _this.displayChange = new core_1.EventEmitter();
        /**
         * Two-Way bound property for the opacity of the layer.
         * Use it with `<yaga-tile-layer [(opacity)]="someValue">`
         * or `<yaga-tile-layer (opacityChange)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-opacity Original Leaflet documentation
         */
        _this.opacityChange = new core_1.EventEmitter();
        /**
         * Two-Way bound property for the zIndex of the layer.
         * Use it with `<yaga-tile-layer [(zIndex)]="someValue">`
         * or `<yaga-tile-layer (zIndexChange)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setzindex Original Leaflet documentation
         */
        _this.zIndexChange = new core_1.EventEmitter();
        /**
         * From leaflet fired add event.
         * Use it with `<yaga-tile-layer (add)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-add Original Leaflet documentation
         */
        _this.addEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired remove event.
         * Use it with `<yaga-tile-layer (remove)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-remove Original Leaflet documentation
         */
        _this.removeEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired popupopen event.
         * Use it with `<yaga-tile-layer (popupopen)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-popupopen Original Leaflet documentation
         */
        _this.popupopenEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired popupclose event.
         * Use it with `<yaga-tile-layer (popupclose)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-popupclose Original Leaflet documentation
         */
        _this.popupcloseEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired tooltipopen event.
         * Use it with `<yaga-tile-layer (tooltipopen)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tooltipopen Original Leaflet documentation
         */
        _this.tooltipopenEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired tooltipclose event.
         * Use it with `<yaga-tile-layer (tooltipclose)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tooltipclose Original Leaflet documentation
         */
        _this.tooltipcloseEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired click event.
         * Use it with `<yaga-tile-layer (click)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-click Original Leaflet documentation
         */
        _this.clickEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired dblclick event.
         * Use it with `<yaga-tile-layer (dblclick)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-dblclick Original Leaflet documentation
         */
        _this.dblclickEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired mousedown event.
         * Use it with `<yaga-tile-layer (mousedown)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-mousedown Original Leaflet documentation
         */
        _this.mousedownEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired mouseover event.
         * Use it with `<yaga-tile-layer (mouseover)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-mouseover Original Leaflet documentation
         */
        _this.mouseoverEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired mouseout event.
         * Use it with `<yaga-tile-layer (mouseout)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-mouseout Original Leaflet documentation
         */
        _this.mouseoutEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired contextmenu event.
         * Use it with `<yaga-tile-layer (contextmenu)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-contextmenu Original Leaflet documentation
         */
        _this.contextmenuEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired loading event.
         * Use it with `<yaga-tile-layer (loading)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-loading Original Leaflet documentation
         */
        _this.loadingEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired tileunload event.
         * Use it with `<yaga-tile-layer (tileunload)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileunload Original Leaflet documentation
         */
        _this.tileunloadEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired tileloadstart event.
         * Use it with `<yaga-tile-layer (tileloadstart)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileloadstart Original Leaflet documentation
         */
        _this.tileloadstartEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired tileerror event.
         * Use it with `<yaga-tile-layer (tileerror)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileerror Original Leaflet documentation
         */
        _this.tileerrorEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired tileload event.
         * Use it with `<yaga-tile-layer (tileload)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileload Original Leaflet documentation
         */
        _this.tileloadEvent = new core_1.EventEmitter();
        /**
         * From leaflet fired load event.
         * Use it with `<yaga-tile-layer (load)="processEvent($event)">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-load Original Leaflet documentation
         */
        _this.loadEvent = new core_1.EventEmitter();
        layerProvider.ref = _this;
        _this.on("remove", function () {
            _this.displayChange.emit(false);
        });
        _this.on("add", function () {
            _this.displayChange.emit(true);
        });
        _this.addTo(_this.layerGroupProvider.ref);
        // Events
        _this.on("add", function (event) {
            _this.addEvent.emit(event);
        });
        _this.on("remove", function (event) {
            _this.removeEvent.emit(event);
        });
        _this.on("popupopen", function (event) {
            _this.popupopenEvent.emit(event);
        });
        _this.on("popupclose", function (event) {
            _this.popupcloseEvent.emit(event);
        });
        _this.on("tooltipopen", function (event) {
            _this.tooltipopenEvent.emit(event);
        });
        _this.on("tooltipclose", function (event) {
            _this.tooltipcloseEvent.emit(event);
        });
        _this.on("click", function (event) {
            _this.clickEvent.emit(event);
        });
        _this.on("dblclick", function (event) {
            _this.dblclickEvent.emit(event);
        });
        _this.on("mousedown", function (event) {
            _this.mousedownEvent.emit(event);
        });
        _this.on("mouseover", function (event) {
            _this.mouseoverEvent.emit(event);
        });
        _this.on("mouseout", function (event) {
            _this.mouseoutEvent.emit(event);
        });
        _this.on("contextmenu", function (event) {
            _this.contextmenuEvent.emit(event);
        });
        _this.on("loading", function (event) {
            _this.loadingEvent.emit(event);
        });
        _this.on("tileunload", function (event) {
            _this.tileunloadEvent.emit(event);
        });
        _this.on("tileloadstart", function (event) {
            _this.tileloadstartEvent.emit(event);
        });
        _this.on("tileerror", function (event) {
            _this.tileerrorEvent.emit(event);
        });
        _this.on("tileload", function (event) {
            _this.tileloadEvent.emit(event);
        });
        _this.on("load", function (event) {
            _this.loadEvent.emit(event);
        });
        return _this;
    }
    /**
     * This function gets called from Angular on destroy of the html-component.
     * @link https://angular.io/docs/ts/latest/api/core/index/OnDestroy-class.html
     */
    TileLayerDirective.prototype.ngOnDestroy = function () {
        this.removeFrom(this.layerGroupProvider.ref);
    };
    /**
     * Derived method of the original setUrl method.
     * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-seturl Original Leaflet documentation
     */
    TileLayerDirective.prototype.setUrl = function (url, noRedraw) {
        if (this.url === url) {
            return this;
        }
        this.urlChange.emit(url);
        return _super.prototype.setUrl.call(this, url, noRedraw);
    };
    Object.defineProperty(TileLayerDirective.prototype, "url", {
        get: function () {
            return this._url;
        },
        /**
         * Two-Way bound property for the URL.
         * Use it with `<yaga-tile-layer [(url)]="someValue">` or `<yaga-tile-layer [url]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-seturl Original Leaflet documentation
         */
        set: function (val) {
            this.setUrl(val);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Derived method of the original setOpacity method.
     * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setopacity Original Leaflet documentation
     */
    TileLayerDirective.prototype.setOpacity = function (val) {
        Iif (this.opacity === val) {
            return this;
        }
        this.opacityChange.emit(val);
        return _super.prototype.setOpacity.call(this, val);
    };
    Object.defineProperty(TileLayerDirective.prototype, "opacity", {
        get: function () {
            return this.options.opacity;
        },
        /**
         * Two-Way bound property for the opacity.
         * Use it with `<yaga-tile-layer [(opacity)]="someValue">` or `<yaga-tile-layer [opacity]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setopacity Original Leaflet documentation
         */
        set: function (val) {
            Iif (val === undefined) {
                val = 1;
            }
            this.setOpacity(val);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "display", {
        /**
         * Two-Way bound property for the display status of the layer.
         * Use it with `<yaga-tile-layer [(display)]="someValue">` or `<yaga-tile-layer [display]="someValue">`
         */
        get: function () {
            var pane;
            var container;
            try {
                pane = this.getPane();
                container = this.getContainer();
            }
            catch (err) {
                /* istanbul ignore next */
                return false;
            }
            /* tslint:disable:prefer-for-of */
            for (var i = 0; i < pane.children.length; i += 1) {
                /* tslint:enable */
                /* istanbul ignore else */
                Eif (pane.children[i] === container) {
                    return true;
                }
            }
            return false;
        },
        /**
         * Two-Way bound property for the display status of the layer.
         * Use it with `<yaga-tile-layer [(display)]="someValue">` or `<yaga-tile-layer [display]="someValue">`
         */
        set: function (val) {
            var isDisplayed = this.display;
            Iif (isDisplayed === val) {
                return;
            }
            var pane;
            var container;
            var map;
            var events; // Dictionary of functions
            var eventKeys;
            try {
                pane = this.getPane();
                container = this.getContainer();
                map = this._map;
                events = this.getEvents();
                eventKeys = Object.keys(events);
            }
            catch (err) {
                /* istanbul ignore next */
                return;
            }
            if (val) {
                // show layer
                pane.appendChild(container);
                for (var _i = 0, eventKeys_1 = eventKeys; _i < eventKeys_1.length; _i++) {
                    var eventKey = eventKeys_1[_i];
                    map.on(eventKey, events[eventKey], this);
                }
                this.redraw();
            }
            else {
                // hide layer
                pane.removeChild(container);
                for (var _a = 0, eventKeys_2 = eventKeys; _a < eventKeys_2.length; _a++) {
                    var eventKey = eventKeys_2[_a];
                    map.off(eventKey, events[eventKey], this);
                }
            }
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Derived method of the original setZIndexmethod.
     * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setzindex Original Leaflet documentation
     */
    TileLayerDirective.prototype.setZIndex = function (val) {
        _super.prototype.setZIndex.call(this, val);
        this.zIndexChange.emit(val);
        return this;
    };
    Object.defineProperty(TileLayerDirective.prototype, "zIndex", {
        get: function () {
            return this.options.zIndex;
        },
        /**
         * Two-Way bound property for the zIndex.
         * Use it with `<yaga-tile-layer [(zIndex)]="someValue">` or `<yaga-tile-layer [zIndex]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setzindex Original Leaflet documentation
         */
        set: function (val) {
            Iif (val === undefined) {
                val = 1;
            }
            this.setZIndex(val);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "tileSize", {
        get: function () {
            return this.options.tileSize;
        },
        /**
         * Input for the tileSize.
         * Use it with `<yaga-tile-layer [tileSize]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileSize Original Leaflet documentation
         */
        set: function (val) {
            this.options.tileSize = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "updateWhenIdle", {
        get: function () {
            return !!this.options.updateWhenIdle;
        },
        /**
         * Input for the updateWhenIdle.
         * Use it with `<yaga-tile-layer [updateWhenIdle]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-updatewhenidle Original Leaflet documentation
         */
        set: function (val) {
            this.options.updateWhenIdle = val;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "updateWhenZooming", {
        get: function () {
            return !!this.options.updateWhenZooming;
        },
        /**
         * Input for the updateWhenZooming.
         * Use it with `<yaga-tile-layer [updateWhenZooming]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-updatewhenzooming Original Leaflet documentation
         */
        set: function (val) {
            this.options.updateWhenZooming = val;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "updateInterval", {
        get: function () {
            return this.options.updateInterval;
        },
        /**
         * Input for the updateInterval.
         * Use it with `<yaga-tile-layer [updateInterval]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-updateinterval Original Leaflet documentation
         */
        set: function (val) {
            this.options.updateInterval = val;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "bounds", {
        get: function () {
            return this.options.bounds;
        },
        /**
         * Input for the bounds.
         * Use it with `<yaga-tile-layer [bounds]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-bounds Original Leaflet documentation
         */
        set: function (val) {
            this.options.bounds = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "noWrap", {
        get: function () {
            return !!this.options.noWrap;
        },
        /**
         * Input for the noWrap.
         * Use it with `<yaga-tile-layer [noWrap]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-nowrap Original Leaflet documentation
         */
        set: function (val) {
            this.options.noWrap = val;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "className", {
        get: function () {
            return this.options.className;
        },
        /**
         * Input for the className.
         * Use it with `<yaga-tile-layer [className]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-classname Original Leaflet documentation
         */
        set: function (val) {
            this.options.className = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "keepBuffer", {
        get: function () {
            return this.options.keepBuffer;
        },
        /**
         * Input for the keepBuffer.
         * Use it with `<yaga-tile-layer [keepBuffer]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-keepbuffer Original Leaflet documentation
         */
        set: function (val) {
            this.options.keepBuffer = val;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "maxZoom", {
        get: function () {
            return this.options.maxZoom;
        },
        /**
         * Input for the maxZoom.
         * Use it with `<yaga-tile-layer [maxZoom]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-maxzoom Original Leaflet documentation
         */
        set: function (val) {
            this.options.maxZoom = val;
            Eif (this._map) {
                this._map._updateZoomLevels();
            }
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "minZoom", {
        get: function () {
            return this.options.minZoom;
        },
        /**
         * Input for the minZoom.
         * Use it with `<yaga-tile-layer [minZoom]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-minzoom Original Leaflet documentation
         */
        set: function (val) {
            this.options.minZoom = val;
            Eif (this._map) {
                this._map._updateZoomLevels();
            }
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "maxNativeZoom", {
        get: function () {
            return this.options.maxNativeZoom;
        },
        /**
         * Input for the maxNativeZoom.
         * Use it with `<yaga-tile-layer [maxNativeZoom]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-maxnativezoom Original Leaflet documentation
         */
        set: function (val) {
            this.options.maxNativeZoom = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "minNativeZoom", {
        get: function () {
            return this.options.minNativeZoom;
        },
        /**
         * Input for the minNativeZoom.
         * Use it with `<yaga-tile-layer [minNativeZoom]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-minnativezoom Original Leaflet documentation
         */
        set: function (val) {
            this.options.minNativeZoom = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "subdomains", {
        get: function () {
            if (typeof this.options.subdomains === "string") {
                this.options.subdomains = this.options.subdomains.split("");
            }
            return this.options.subdomains;
        },
        /**
         * Input for the subdomains.
         * Use it with `<yaga-tile-layer [subdomains]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-subdomains Original Leaflet documentation
         */
        set: function (val) {
            this.options.subdomains = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "errorTileUrl", {
        get: function () {
            return this.options.errorTileUrl;
        },
        /**
         * Input for the errorTileUrl.
         * Use it with `<yaga-tile-layer [errorTileUrl]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-errortileurl Original Leaflet documentation
         */
        set: function (val) {
            this.options.errorTileUrl = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "zoomOffset", {
        get: function () {
            return this.options.zoomOffset;
        },
        /**
         * Input for the zoomOffset.
         * Use it with `<yaga-tile-layer [zoomOffset]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-zoomoffset Original Leaflet documentation
         */
        set: function (val) {
            this.options.zoomOffset = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "tms", {
        get: function () {
            return !!this.options.tms;
        },
        /**
         * Input for the tms.
         * Use it with `<yaga-tile-layer [tms]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tms Original Leaflet documentation
         */
        set: function (val) {
            this.options.tms = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "zoomReverse", {
        get: function () {
            return !!this.options.zoomReverse;
        },
        /**
         * Input for the zoomReverse.
         * Use it with `<yaga-tile-layer [zoomReverse]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-zoomreverse Original Leaflet documentation
         */
        set: function (val) {
            this.options.zoomReverse = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "detectRetina", {
        get: function () {
            return !!this.options.detectRetina;
        },
        /**
         * Input for the detectRetina.
         * Use it with `<yaga-tile-layer [detectRetina]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-detectretina Original Leaflet documentation
         */
        set: function (val) {
            this.options.detectRetina = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "crossOrigin", {
        get: function () {
            return !!this.options.crossOrigin;
        },
        /**
         * Input for the crossOrigin.
         * Use it with `<yaga-tile-layer [crossOrigin]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-crossorigin Original Leaflet documentation
         */
        set: function (val) {
            this.options.crossOrigin = val;
            this.redraw();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TileLayerDirective.prototype, "attribution", {
        get: function () {
            return this.getAttribution() || "";
        },
        /**
         * Input for the attribution.
         * Use it with `<yaga-tile-layer [attribution]="someValue">`
         * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-attribution Original Leaflet documentation
         */
        set: function (val) {
            Eif (this._map && this._map.attributionControl) {
                var oldAttribution = this.getAttribution();
                if (oldAttribution) {
                    this._map.attributionControl.removeAttribution(oldAttribution);
                }
                this._map.attributionControl.addAttribution(val);
            }
            this.options.attribution = val;
        },
        enumerable: true,
        configurable: true
    });
    __decorate([
        core_1.Output(),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "urlChange", void 0);
    __decorate([
        core_1.Output(),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "displayChange", void 0);
    __decorate([
        core_1.Output(),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "opacityChange", void 0);
    __decorate([
        core_1.Output(),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "zIndexChange", void 0);
    __decorate([
        core_1.Output("add"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "addEvent", void 0);
    __decorate([
        core_1.Output("remove"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "removeEvent", void 0);
    __decorate([
        core_1.Output("popupopen"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "popupopenEvent", void 0);
    __decorate([
        core_1.Output("popupclose"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "popupcloseEvent", void 0);
    __decorate([
        core_1.Output("tooltipopen"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "tooltipopenEvent", void 0);
    __decorate([
        core_1.Output("tooltipclose"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "tooltipcloseEvent", void 0);
    __decorate([
        core_1.Output("click"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "clickEvent", void 0);
    __decorate([
        core_1.Output("dblclick"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "dblclickEvent", void 0);
    __decorate([
        core_1.Output("mousedown"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "mousedownEvent", void 0);
    __decorate([
        core_1.Output("mouseover"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "mouseoverEvent", void 0);
    __decorate([
        core_1.Output("mouseout"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "mouseoutEvent", void 0);
    __decorate([
        core_1.Output("contextmenu"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "contextmenuEvent", void 0);
    __decorate([
        core_1.Output("loading"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "loadingEvent", void 0);
    __decorate([
        core_1.Output("tileunload"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "tileunloadEvent", void 0);
    __decorate([
        core_1.Output("tileloadstart"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "tileloadstartEvent", void 0);
    __decorate([
        core_1.Output("tileerror"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "tileerrorEvent", void 0);
    __decorate([
        core_1.Output("tileload"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "tileloadEvent", void 0);
    __decorate([
        core_1.Output("load"),
        __metadata("design:type", core_1.EventEmitter)
    ], TileLayerDirective.prototype, "loadEvent", void 0);
    __decorate([
        core_1.Input(),
        __metadata("design:type", String),
        __metadata("design:paramtypes", [String])
    ], TileLayerDirective.prototype, "url", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "opacity", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "display", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "zIndex", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", leaflet_1.Point),
        __metadata("design:paramtypes", [leaflet_1.Point])
    ], TileLayerDirective.prototype, "tileSize", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "updateWhenIdle", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "updateWhenZooming", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "updateInterval", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "bounds", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "noWrap", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "className", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "keepBuffer", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "maxZoom", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "minZoom", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "maxNativeZoom", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "minNativeZoom", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Array),
        __metadata("design:paramtypes", [Array])
    ], TileLayerDirective.prototype, "subdomains", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "errorTileUrl", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Object),
        __metadata("design:paramtypes", [Object])
    ], TileLayerDirective.prototype, "zoomOffset", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "tms", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "zoomReverse", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "detectRetina", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], TileLayerDirective.prototype, "crossOrigin", null);
    __decorate([
        core_1.Input(),
        __metadata("design:type", String),
        __metadata("design:paramtypes", [String])
    ], TileLayerDirective.prototype, "attribution", null);
    TileLayerDirective = __decorate([
        core_1.Directive({
            providers: [layer_provider_1.LayerProvider],
            selector: "yaga-tile-layer",
        }),
        __metadata("design:paramtypes", [layer_group_provider_1.LayerGroupProvider,
            layer_provider_1.LayerProvider])
    ], TileLayerDirective);
    return TileLayerDirective;
}(leaflet_1.TileLayer));
exports.TileLayerDirective = TileLayerDirective;
//# sourceMappingURL=tile-layer.directive.js.map