@yaga/leaflet-ng2
Version:
Angular2 module for Leaflet
1,151 lines • 45.6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MapComponent = void 0;
const core_1 = require("@angular/core");
const leaflet_1 = require("leaflet");
const consts_1 = require("./consts");
const layer_group_provider_1 = require("./layer-group.provider");
const map_provider_1 = require("./map.provider");
const i0 = require("@angular/core");
const i1 = require("./layer-group.provider");
const i2 = require("./map.provider");
const _c0 = ["*"];
/**
* Angular2 root component for a Leaflet map
*
* *You can use this directive in an Angular2 template after importing `YagaModule`.*
*
* How to use in a template:
* ```html
* <yaga-map
* [(zoom)]="..."
* [(lat)]="..."
* [(lng)]="..."
* [(minZoom)]="..."
* [(maxZoom)]="..."
* [(maxBounds)]="..."
*
* (baselayerchange)="..."
* (overlayadd)="..."
* (overlayremove)="..."
* (layeradd)="..."
* (layerremove)="..."
* (zoomlevelschan)="..."
* (resize)="..."
* (unload)="..."
* (viewreset)="..."
* (load)="..."
* (zoomstart)="..."
* (movestart)="..."
* (zoom)="..."
* (move)="..."
* (zoomend)="..."
* (moveend)="..."
* (popupopen)="..."
* (popupclose)="..."
* (autopanstart)="..."
* (tooltipopen)="..."
* (tooltipclose)="..."
* (click)="..."
* (dblclick)="..."
* (mousedown)="..."
* (mouseup)="..."
* (mouseover)="..."
* (mouseout)="..."
* (mousemove)="..."
* (contextmenu)="..."
* (keypress)="..."
* (preclick)="..."
* (zoomanim)="..."
*
* [crs]="..."
* [closePopupOnClick]="..."
* [zoomSnap]="..."
* [zoomDelta]="..."
* [trackResize]="..."
* [boxZoomEnabled]="..."
* [doubleClickZoomEnabled]="..."
* [draggingEnabled]="..."
* [fadeAnimation]="..."
* [markerZoomAnimation]="..."
* [transform3DLimit]="..."
* [zoomAnimation]="..."
* [zoomAnimationThreshold]="..."
* [inertia]="..."
* [inertiaDeceleration]="..."
* [inertiaMaxSpeed]="..."
* [easeLinearity]="..."
* [worldCopyJump]="..."
* [maxBoundsViscosity]="..."
* [keyboardEnabled]="..."
* [keyboardPanDelta]="..."
* [scrollWheelZoomEnabled]="..."
* [wheelDebounceTime]="..."
* [wheelPxPerZoomLevel]="..."
* [tapEnabled]="..."
* [tapTolerance]="..."
* [bounceAtZoomLimits]="..."
* [touchZoomEnabled]="...">
* <!-- other yaga directives -->
* </yaga-map>
* ```
*
* You can use the following directives as child of this one:
*
* * yaga-attribution-control
* * yaga-circle
* * yaga-circle-marker
* * yaga-geojson
* * yaga-image-overlay
* * yaga-marker
* * yaga-polygon
* * yaga-polyline
* * yaga-rectangle
* * yaga-scale-control
* * yaga-tile-layer
* * yaga-wms-layer
* * yaga-zoom-control
*
* @link http://leafletjs.com/reference-1.2.0.html#tilelayer Original Leaflet documentation
* @link https://leaflet-ng2.yagajs.org/latest/browser-test?grep=Tile-Layer%20Directive Unit-Test
* @link https://leaflet-ng2.yagajs.org/latest/coverage/lcov-report/lib/tile-layer.directive.js.html Test coverage
* @link https://leaflet-ng2.yagajs.org/latest/typedoc/classes/tilelayerdirective.html API documentation
* @example https://leaflet-ng2.yagajs.org/latest/examples/tile-layer-directive
*/
class MapComponent extends leaflet_1.Map {
constructor(elementRef, layerProvider, mapProvider) {
super(elementRef.nativeElement, { attributionControl: false, zoomControl: false });
/**
* Two-Way bound property for the zoom.
* Use it with `<yaga-map [(zoom)]="someValue">` or `<yaga-map (zoomChange)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setzoom Original Leaflet documentation
*/
this.zoomChange = new core_1.EventEmitter();
/**
* Two-Way bound property for the center latitude.
* Use it with `<yaga-map [(lat)]="someValue">` or `<yaga-map (latChange)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setview Original Leaflet documentation
*/
this.latChange = new core_1.EventEmitter();
/**
* Two-Way bound property for the center longitude.
* Use it with `<yaga-map [(lng)]="someValue">` or `<yaga-map (lngChange)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setview Original Leaflet documentation
*/
this.lngChange = new core_1.EventEmitter();
/**
* Two-Way bound property for the minimal available zoom.
* Use it with `<yaga-map [(minZoom)]="someValue">` or `<yaga-map (minZoomChange)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setminzoom Original Leaflet documentation
*/
this.minZoomChange = new core_1.EventEmitter();
/**
* Two-Way bound property for the maximal available zoom.
* Use it with `<yaga-map [(maxZoom)]="someValue">` or `<yaga-map (maxZoomChange)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setmaxzoom Original Leaflet documentation
*/
this.maxZoomChange = new core_1.EventEmitter();
/**
* Two-Way bound property for the bounds on the map.
* Use it with `<yaga-map [(maxBounds)]="someValue">`
* or `<yaga-map (maxBoundsChange)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setmaxbounds Original Leaflet documentation
*/
this.maxBoundsChange = new core_1.EventEmitter();
/**
* From leaflet fired baselayerchange event.
* Use it with `<yaga-tile-layer (baselayerchange)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-baselayerchange Original Leaflet documentation
*/
this.baselayerchangeEvent = new core_1.EventEmitter();
/**
* From leaflet fired overlayadd event.
* Use it with `<yaga-tile-layer (overlayadd)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-overlayadd Original Leaflet documentation
*/
this.overlayaddEvent = new core_1.EventEmitter();
/**
* From leaflet fired overlayremove event.
* Use it with `<yaga-tile-layer (overlayremove)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-overlayremove Original Leaflet documentation
*/
this.overlayremoveEvent = new core_1.EventEmitter();
/**
* From leaflet fired layeradd event.
* Use it with `<yaga-tile-layer (layeradd)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-layeradd Original Leaflet documentation
*/
this.layeraddEvent = new core_1.EventEmitter();
/**
* From leaflet fired layerremove event.
* Use it with `<yaga-tile-layer (layerremove)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-layerremove Original Leaflet documentation
*/
this.layerremoveEvent = new core_1.EventEmitter();
/**
* From leaflet fired zoomlevelschan event.
* Use it with `<yaga-tile-layer (zoomlevelschan)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomlevelschan Original Leaflet documentation
*/
this.zoomlevelschangeEvent = new core_1.EventEmitter();
/**
* From leaflet fired resize event.
* Use it with `<yaga-tile-layer (resize)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-resize Original Leaflet documentation
*/
this.resizeEvent = new core_1.EventEmitter();
/**
* From leaflet fired unload event.
* Use it with `<yaga-tile-layer (unload)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-unload Original Leaflet documentation
*/
this.unloadEvent = new core_1.EventEmitter();
/**
* From leaflet fired viewreset event.
* Use it with `<yaga-tile-layer (viewreset)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-viewreset Original Leaflet documentation
*/
this.viewresetEvent = 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#map-load Original Leaflet documentation
*/
this.loadEvent = new core_1.EventEmitter();
/**
* From leaflet fired zoomstart event.
* Use it with `<yaga-tile-layer (zoomstart)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomstart Original Leaflet documentation
*/
this.zoomstartEvent = new core_1.EventEmitter();
/**
* From leaflet fired movestart event.
* Use it with `<yaga-tile-layer (movestart)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-movestart Original Leaflet documentation
*/
this.movestartEvent = new core_1.EventEmitter();
/**
* From leaflet fired zoom event.
* Use it with `<yaga-tile-layer (zoom)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoom Original Leaflet documentation
*/
this.zoomEvent = new core_1.EventEmitter();
/**
* From leaflet fired move event.
* Use it with `<yaga-tile-layer (move)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-move Original Leaflet documentation
*/
this.moveEvent = new core_1.EventEmitter();
/**
* From leaflet fired zoomend event.
* Use it with `<yaga-tile-layer (zoomend)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomend Original Leaflet documentation
*/
this.zoomendEvent = new core_1.EventEmitter();
/**
* From leaflet fired moveend event.
* Use it with `<yaga-tile-layer (moveend)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-moveend Original Leaflet documentation
*/
this.moveendEvent = new core_1.EventEmitter();
/**
* From leaflet fired (undocumented) boxzoomstart event.
* Use it with `<yaga-tile-layer (boxzoomstart)="processEvent($event)">`
* @link https://github.com/Leaflet/Leaflet/blob/master/src/map/handler/Map.BoxZoom.js SourceCode
*/
this.boxzoomstartEvent = new core_1.EventEmitter();
/**
* From leaflet fired (undocumented) boxzoomend event.
* Use it with `<yaga-tile-layer (boxzoomend)="processEvent($event)">`
* @link https://github.com/Leaflet/Leaflet/blob/master/src/map/handler/Map.BoxZoom.js SourceCode
*/
this.boxzoomendEvent = 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#map-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#map-popupclose Original Leaflet documentation
*/
this.popupcloseEvent = new core_1.EventEmitter();
/**
* From leaflet fired autopanstart event.
* Use it with `<yaga-tile-layer (autopanstart)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-autopanstart Original Leaflet documentation
*/
this.autopanstartEvent = 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#map-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#map-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#map-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#map-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#map-mousedown Original Leaflet documentation
*/
this.mousedownEvent = new core_1.EventEmitter();
/**
* From leaflet fired mouseup event.
* Use it with `<yaga-tile-layer (mouseup)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-mouseup Original Leaflet documentation
*/
this.mouseupEvent = 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#map-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#map-mouseout Original Leaflet documentation
*/
this.mouseoutEvent = new core_1.EventEmitter();
/**
* From leaflet fired mousemove event.
* Use it with `<yaga-tile-layer (mousemove)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-mousemove Original Leaflet documentation
*/
this.mousemoveEvent = 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#map-contextmenu Original Leaflet documentation
*/
this.contextmenuEvent = new core_1.EventEmitter();
/**
* From leaflet fired keypress event.
* Use it with `<yaga-tile-layer (keypress)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-keypress Original Leaflet documentation
*/
this.keypressEvent = new core_1.EventEmitter();
/**
* From leaflet fired preclick event.
* Use it with `<yaga-tile-layer (preclick)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-preclick Original Leaflet documentation
*/
this.preclickEvent = new core_1.EventEmitter();
/**
* From leaflet fired zoomanim event.
* Use it with `<yaga-tile-layer (zoomanim)="processEvent($event)">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomanim Original Leaflet documentation
*/
this.zoomanimEvent = new core_1.EventEmitter();
this.isZooming = false;
mapProvider.ref = this;
layerProvider.ref = this;
const moveFn = () => {
if (this.isZooming) {
this.moveTimeout = setTimeout(moveFn, consts_1.ANIMATION_DELAY);
return;
}
this.latChange.emit(this.lat);
this.lngChange.emit(this.lng);
this.zoomChange.emit(this.zoom);
this.moveTimeout = undefined;
};
this.setView([0, 0], 0);
elementRef.nativeElement.setAttribute("class", elementRef.nativeElement.getAttribute("class") + " yaga-map");
this.on("move", () => {
if (this.moveTimeout) {
clearTimeout(this.moveTimeout);
}
this.moveTimeout = setTimeout(moveFn, consts_1.ANIMATION_DELAY);
});
this.on("zoomstart", () => {
this.isZooming = true;
});
this.on("zoomend", () => {
this.isZooming = false;
if (this.moveTimeout) {
clearTimeout(this.moveTimeout);
}
this.moveTimeout = setTimeout(moveFn, consts_1.ANIMATION_DELAY);
});
this.on("baselayerchange", (event) => {
this.baselayerchangeEvent.emit(event);
});
this.on("overlayadd", (event) => {
this.overlayaddEvent.emit(event);
});
this.on("overlayremove", (event) => {
this.overlayremoveEvent.emit(event);
});
this.on("layeradd", (event) => {
this.layeraddEvent.emit(event);
});
this.on("layerremove", (event) => {
this.layerremoveEvent.emit(event);
});
this.on("zoomlevelschange", (event) => {
this.zoomlevelschangeEvent.emit(event);
});
this.on("resize", (event) => {
this.resizeEvent.emit(event);
});
this.on("unload", (event) => {
this.unloadEvent.emit(event);
});
this.on("viewreset", (event) => {
this.viewresetEvent.emit(event);
});
this.on("load", (event) => {
this.loadEvent.emit(event);
});
this.on("zoomstart", (event) => {
this.zoomstartEvent.emit(event);
});
this.on("movestart", (event) => {
this.movestartEvent.emit(event);
});
this.on("zoom", (event) => {
this.zoomEvent.emit(event);
});
this.on("move", (event) => {
this.moveEvent.emit(event);
});
this.on("zoomend", (event) => {
this.zoomendEvent.emit(event);
});
this.on("moveend", (event) => {
this.moveendEvent.emit(event);
});
this.on("boxzoomstart", (event) => {
this.boxzoomstartEvent.emit(event);
});
this.on("boxzoomend", (event) => {
this.boxzoomendEvent.emit(event);
});
this.on("popupopen", (event) => {
this.popupopenEvent.emit(event);
});
this.on("popupclose", (event) => {
this.popupcloseEvent.emit(event);
});
this.on("autopanstart", (event) => {
this.autopanstartEvent.emit(event);
});
this.on("tooltipopen", (event) => {
this.tooltipopenEvent.emit(event);
});
this.on("tooltipclose", (event) => {
this.tooltipcloseEvent.emit(event);
});
this.on("click", (event) => {
this.clickEvent.emit(event);
});
this.on("dblclick", (event) => {
this.dblclickEvent.emit(event);
});
this.on("mousedown", (event) => {
this.mousedownEvent.emit(event);
});
this.on("mouseup", (event) => {
this.mouseupEvent.emit(event);
});
this.on("mouseover", (event) => {
this.mouseoverEvent.emit(event);
});
this.on("mouseout", (event) => {
this.mouseoutEvent.emit(event);
});
this.on("mousemove", (event) => {
this.mousemoveEvent.emit(event);
});
this.on("contextmenu", (event) => {
this.contextmenuEvent.emit(event);
});
this.on("keypress", (event) => {
this.keypressEvent.emit(event);
});
this.on("preclick", (event) => {
this.preclickEvent.emit(event);
});
this.on("zoomanim", (event) => {
this.zoomanimEvent.emit(event);
});
}
/**
* This function gets called from Angular after initializing the html-component.
* @link https://angular.io/docs/ts/latest/api/core/index/AfterViewInit-class.html
*/
ngAfterViewInit() {
this.invalidateSize(false);
}
/*setZoom(zoom: number, options?: ZoomPanOptions): this {
if (this.zoom === zoom) {
return;
}
this.zoomChange.emit(zoom);
return super.setZoom(zoom, options)
}*/
// already handled with moveend
// setView(center: LatLngExpression, zoom: number, options?: ZoomPanOptions): this {
/**
* Two-Way bound property for the zoom.
* Use it with `<yaga-map [(zoom)]="someValue">` or `<yaga-map [zoom]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setzoom Original Leaflet documentation
*/
set zoom(val) {
this.setZoom(val);
}
get zoom() {
return this.getZoom();
}
/**
* Two-Way bound property for the latitude.
* Use it with `<yaga-map [(lat)]="someValue">` or `<yaga-map [lat]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setview Original Leaflet documentation
*/
set lat(val) {
const coords = new leaflet_1.LatLng(val, this.getCenter().lng);
this.setView(coords, this.zoom);
}
get lat() {
return this.getCenter().lat;
}
/**
* Two-Way bound property for the longitude.
* Use it with `<yaga-map [(lng)]="someValue">` or `<yaga-map [lng]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setview Original Leaflet documentation
*/
set lng(val) {
const coords = new leaflet_1.LatLng(this.getCenter().lat, val);
this.setView(coords, this.zoom);
}
get lng() {
return this.getCenter().lng;
}
/**
* Derived method of the original setMinZoom method.
* @link http://leafletjs.com/reference-1.2.0.html#map-setminzoom Original Leaflet documentation
*/
setMinZoom(val) {
this.minZoomChange.emit(val);
return super.setMinZoom(val);
}
/**
* Two-Way bound property for the minimal availabe zoom.
* Use it with `<yaga-map [(minZoom)]="someValue">` or `<yaga-map [minZoom]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setminzoom Original Leaflet documentation
*/
set minZoom(val) {
this.setMinZoom(val);
}
get minZoom() {
return this.getMinZoom();
}
/**
* Derived method of the original setMaxZoom method.
* @link http://leafletjs.com/reference-1.2.0.html#map-setmaxzoom Original Leaflet documentation
*/
setMaxZoom(val) {
this.maxZoomChange.emit(val);
return super.setMaxZoom(val);
}
/**
* Two-Way bound property for the maximal availabe zoom.
* Use it with `<yaga-map [(maxZoom)]="someValue">` or `<yaga-map [maxZoom]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-setmaxzoom Original Leaflet documentation
*/
set maxZoom(val) {
this.setMaxZoom(val);
}
get maxZoom() {
return this.getMaxZoom();
}
/**
* Inherited function to provide event emitting.
*/
setMaxBounds(bounds) {
super.setMaxBounds(bounds);
this.maxBoundsChange.emit(this.maxBounds);
return this;
}
/**
* One-Way property for the Coordinate Reference System.
* Use it with `<yaga-map [crs]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-crs Original Leaflet documentation
*/
set crs(val) {
this.options.crs = val;
const keys = Object.keys(this._layers);
for (const key of keys) {
if (typeof this._layers[key].redraw === "function") {
this._layers[key].redraw();
}
}
}
get crs() {
return this.options.crs;
}
/**
* Two-Way bound property for the maximal bounds.
* Use it with `<yaga-map [(maxBounds)]="someValue">` or `<yaga-map [maxBounds]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-maxbounds Original Leaflet documentation
*/
set maxBounds(val) {
this.setMaxBounds(val);
}
get maxBounds() {
return this.options.maxBounds;
}
// One-way Input
/**
* Input for the closePopupOnClick.
* Use it with `<yaga-map [closePopupOnClick]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-closepopuponclick Original Leaflet documentation
*/
set closePopupOnClick(val) {
this.options.closePopupOnClick = val;
}
get closePopupOnClick() {
return this.options.closePopupOnClick;
}
/**
* Input for the zoomSnap.
* Use it with `<yaga-map [zoomSnap]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomsnap Original Leaflet documentation
*/
set zoomSnap(val) {
this.options.zoomSnap = val;
}
get zoomSnap() {
return this.options.zoomSnap;
}
/**
* Input for the zoomDelta.
* Use it with `<yaga-map [zoomDelta]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomdelta Original Leaflet documentation
*/
set zoomDelta(val) {
this.options.zoomDelta = val;
}
get zoomDelta() {
return this.options.zoomDelta;
}
/**
* Input for the trackResize.
* Use it with `<yaga-map [trackResize]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-trackresize Original Leaflet documentation
*/
set trackResize(val) {
this.options.trackResize = val;
}
get trackResize() {
return this.options.trackResize;
}
// maybe 2way!?!
/**
* Input for the boxZoomEnabled.
* Use it with `<yaga-map [boxZoomEnabled]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-boxzoom Original Leaflet documentation
*/
set boxZoomEnabled(val) {
if (val) {
this.boxZoom.enable();
return;
}
this.boxZoom.disable();
}
get boxZoomEnabled() {
return this.boxZoom.enabled();
}
// maybe 2way!?!
/**
* Input for the doubleClickZoomEnabled.
* Use it with `<yaga-map [doubleClickZoomEnabled]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-doubleclickzoom Original Leaflet documentation
*/
set doubleClickZoomEnabled(val) {
if (val) {
this.doubleClickZoom.enable();
return;
}
this.doubleClickZoom.disable();
}
get doubleClickZoomEnabled() {
return this.doubleClickZoom.enabled();
}
// maybe 2way!?!
/**
* Input for the draggingEnabled.
* Use it with `<yaga-map [draggingEnabled]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-dragging Original Leaflet documentation
*/
set draggingEnabled(val) {
if (val) {
this.dragging.enable();
return;
}
this.dragging.disable();
}
get draggingEnabled() {
return this.dragging.enabled();
}
/**
* Input for the fadeAnimation.
* Use it with `<yaga-map [fadeAnimation]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-fadeanimation Original Leaflet documentation
*/
set fadeAnimation(val) {
this.options.fadeAnimation = val;
}
get fadeAnimation() {
return !!this.options.fadeAnimation;
}
/**
* Input for the markerZoomAnimation.
* Use it with `<yaga-map [markerZoomAnimation]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-markerzoomanimation Original Leaflet documentation
*/
set markerZoomAnimation(val) {
this.options.markerZoomAnimation = val;
}
get markerZoomAnimation() {
return !!this.options.markerZoomAnimation;
}
/**
* Input for the transform3DLimit.
* Use it with `<yaga-map [transform3DLimit]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-transform3dlimit Original Leaflet documentation
*/
set transform3DLimit(val) {
this.options.transform3DLimit = val;
}
get transform3DLimit() {
return this.options.transform3DLimit;
}
/**
* Input for the zoomAnimation.
* Use it with `<yaga-map [zoomAnimation]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomanimation Original Leaflet documentation
*/
set zoomAnimation(val) {
this.options.zoomAnimation = val;
}
get zoomAnimation() {
return !!this.options.zoomAnimation;
}
/**
* Input for the zoomAnimationThreshold.
* Use it with `<yaga-map [zoomAnimationThreshold]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-zoomanimationthreshold Original Leaflet documentation
*/
set zoomAnimationThreshold(val) {
this.options.zoomAnimationThreshold = val;
}
get zoomAnimationThreshold() {
return this.options.zoomAnimationThreshold;
}
/**
* Input for the inertia.
* Use it with `<yaga-map [inertia]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-inertia Original Leaflet documentation
*/
set inertia(val) {
this.options.inertia = val;
}
get inertia() {
return !!this.options.inertia;
}
/**
* Input for the inertiaDeceleration.
* Use it with `<yaga-map [inertiaDeceleration]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-inertiadeceleration Original Leaflet documentation
*/
set inertiaDeceleration(val) {
this.options.inertiaDeceleration = val;
}
get inertiaDeceleration() {
return this.options.inertiaDeceleration;
}
/**
* Input for the inertiaMaxSpeed.
* Use it with `<yaga-map [inertiaMaxSpeed]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-inertiamaxspeed Original Leaflet documentation
*/
set inertiaMaxSpeed(val) {
this.options.inertiaMaxSpeed = val;
}
get inertiaMaxSpeed() {
return this.options.inertiaMaxSpeed;
}
/**
* Input for the easeLinearity.
* Use it with `<yaga-map [easeLinearity]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-easelinearity Original Leaflet documentation
*/
set easeLinearity(val) {
this.options.easeLinearity = val;
}
get easeLinearity() {
return this.options.easeLinearity;
}
/**
* Input for the worldCopyJump.
* Use it with `<yaga-map [worldCopyJump]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-worldcopyjump Original Leaflet documentation
*/
set worldCopyJump(val) {
this.options.worldCopyJump = val;
}
get worldCopyJump() {
return !!this.options.worldCopyJump;
}
/**
* Input for the maxBoundsViscosity.
* Use it with `<yaga-map [maxBoundsViscosity]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-maxboundsviscosity Original Leaflet documentation
*/
set maxBoundsViscosity(val) {
this.options.maxBoundsViscosity = val;
}
get maxBoundsViscosity() {
return this.options.maxBoundsViscosity;
}
// maybe 2way!?!
/**
* Input for the keyboardEnabled.
* Use it with `<yaga-map [keyboardEnabled]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-keyboard Original Leaflet documentation
*/
set keyboardEnabled(val) {
if (val) {
this.keyboard.enable();
return;
}
this.keyboard.disable();
}
get keyboardEnabled() {
return this.keyboard.enabled();
}
/**
* Input for the keyboardPanDelta.
* Use it with `<yaga-map [keyboardPanDelta]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-keyboardpandelta Original Leaflet documentation
*/
set keyboardPanDelta(val) {
this.options.keyboardPanDelta = val;
}
get keyboardPanDelta() {
return this.options.keyboardPanDelta;
}
// maybe 2way!?!
/**
* Input for the scrollWheelZoomEnabled.
* Use it with `<yaga-map [scrollWheelZoomEnabled]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-scrollwheelzoom Original Leaflet documentation
*/
set scrollWheelZoomEnabled(val) {
if (val) {
this.scrollWheelZoom.enable();
return;
}
this.scrollWheelZoom.disable();
}
get scrollWheelZoomEnabled() {
return this.scrollWheelZoom.enabled();
}
/**
* Input for the wheelDebounceTime.
* Use it with `<yaga-map [wheelDebounceTime]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-wheeldebouncetime Original Leaflet documentation
*/
set wheelDebounceTime(val) {
this.options.wheelDebounceTime = val;
}
get wheelDebounceTime() {
return this.options.wheelDebounceTime;
}
/**
* Input for the wheelPxPerZoomLevel.
* Use it with `<yaga-map [wheelPxPerZoomLevel]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-wheelpxperzoomlevel Original Leaflet documentation
*/
set wheelPxPerZoomLevel(val) {
this.options.wheelPxPerZoomLevel = val;
}
get wheelPxPerZoomLevel() {
return this.options.wheelPxPerZoomLevel;
}
/**
* Input for the tapEnabled.
* Use it with `<yaga-map [tapEnabled]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-tap Original Leaflet documentation
*/
set tapEnabled(val) {
this.options.tap = val;
}
get tapEnabled() {
return !!this.options.tap;
}
/**
* Input for the tapTolerance.
* Use it with `<yaga-map [tapTolerance]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-taptolerance Original Leaflet documentation
*/
set tapTolerance(val) {
this.options.tapTolerance = val;
}
get tapTolerance() {
return this.options.tapTolerance;
}
/**
* Input for the bounceAtZoomLimits.
* Use it with `<yaga-map [bounceAtZoomLimits]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-bounceatzoomlimits Original Leaflet documentation
*/
set bounceAtZoomLimits(val) {
this.options.bounceAtZoomLimits = val;
}
get bounceAtZoomLimits() {
return !!this.options.bounceAtZoomLimits;
}
// maybe 2way!?!
/**
* Input for the touchZoomEnabled.
* Use it with `<yaga-map [touchZoomEnabled]="someValue">`
* @link http://leafletjs.com/reference-1.2.0.html#map-touchzoom Original Leaflet documentation
*/
set touchZoomEnabled(val) {
if (val) {
this.touchZoom.enable();
return;
}
this.touchZoom.disable();
}
get touchZoomEnabled() {
return this.touchZoom.enabled();
}
}
exports.MapComponent = MapComponent;
MapComponent.ɵfac = function MapComponent_Factory(t) { return new (t || MapComponent)(i0.ɵɵdirectiveInject(core_1.ElementRef), i0.ɵɵdirectiveInject(i1.LayerGroupProvider, 1), i0.ɵɵdirectiveInject(i2.MapProvider)); };
MapComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MapComponent, selectors: [["yaga-map"]], inputs: { zoom: "zoom", lat: "lat", lng: "lng", minZoom: "minZoom", maxZoom: "maxZoom", crs: "crs", maxBounds: "maxBounds", closePopupOnClick: "closePopupOnClick", zoomSnap: "zoomSnap", zoomDelta: "zoomDelta", trackResize: "trackResize", boxZoomEnabled: "boxZoomEnabled", doubleClickZoomEnabled: "doubleClickZoomEnabled", draggingEnabled: "draggingEnabled", fadeAnimation: "fadeAnimation", markerZoomAnimation: "markerZoomAnimation", transform3DLimit: "transform3DLimit", zoomAnimation: "zoomAnimation", zoomAnimationThreshold: "zoomAnimationThreshold", inertia: "inertia", inertiaDeceleration: "inertiaDeceleration", inertiaMaxSpeed: "inertiaMaxSpeed", easeLinearity: "easeLinearity", worldCopyJump: "worldCopyJump", maxBoundsViscosity: "maxBoundsViscosity", keyboardEnabled: "keyboardEnabled", keyboardPanDelta: "keyboardPanDelta", scrollWheelZoomEnabled: "scrollWheelZoomEnabled", wheelDebounceTime: "wheelDebounceTime", wheelPxPerZoomLevel: "wheelPxPerZoomLevel", tapEnabled: "tapEnabled", tapTolerance: "tapTolerance", bounceAtZoomLimits: "bounceAtZoomLimits", touchZoomEnabled: "touchZoomEnabled" }, outputs: { zoomChange: "zoomChange", latChange: "latChange", lngChange: "lngChange", minZoomChange: "minZoomChange", maxZoomChange: "maxZoomChange", maxBoundsChange: "maxBoundsChange", baselayerchangeEvent: "baselayerchange", overlayaddEvent: "overlayadd", overlayremoveEvent: "overlayremove", layeraddEvent: "layeradd", layerremoveEvent: "layerremove", zoomlevelschangeEvent: "zoomlevelschange", resizeEvent: "resize", unloadEvent: "unload", viewresetEvent: "viewreset", loadEvent: "load", zoomstartEvent: "zoomstart", movestartEvent: "movestart", zoomEvent: "zoom", moveEvent: "move", zoomendEvent: "zoomend", moveendEvent: "moveend", boxzoomstartEvent: "boxzoomstart", boxzoomendEvent: "boxzoomend", popupopenEvent: "popupopen", popupcloseEvent: "popupclose", autopanstartEvent: "autopanstart", tooltipopenEvent: "tooltipopen", tooltipcloseEvent: "tooltipclose", clickEvent: "click", dblclickEvent: "dblclick", mousedownEvent: "mousedown", mouseupEvent: "mouseup", mouseoverEvent: "mouseover", mouseoutEvent: "mouseout", mousemoveEvent: "mousemove", contextmenuEvent: "contextmenu", keypressEvent: "keypress", preclickEvent: "preclick", zoomanimEvent: "zoomanim" }, features: [i0.ɵɵProvidersFeature([layer_group_provider_1.LayerGroupProvider, map_provider_1.MapProvider]), i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0, decls: 2, vars: 0, consts: [[2, "display", "none"]], template: function MapComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵprojectionDef();
i0.ɵɵelementStart(0, "span", 0);
i0.ɵɵprojection(1);
i0.ɵɵelementEnd();
} }, styles: ["[_nghost-%COMP%] { display: block; }"] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MapComponent, [{
type: core_1.Component,
args: [{
providers: [layer_group_provider_1.LayerGroupProvider, map_provider_1.MapProvider],
selector: "yaga-map",
styles: [`:host { display: block; }`],
template: `<span style="display: none"><ng-content></ng-content></span>`,
}]
}], function () { return [{ type: i0.ElementRef, decorators: [{
type: core_1.Inject,
args: [core_1.ElementRef]
}] }, { type: i1.LayerGroupProvider, decorators: [{
type: core_1.Host
}] }, { type: i2.MapProvider }]; }, { zoomChange: [{
type: core_1.Output
}], latChange: [{
type: core_1.Output
}], lngChange: [{
type: core_1.Output
}], minZoomChange: [{
type: core_1.Output
}], maxZoomChange: [{
type: core_1.Output
}], maxBoundsChange: [{
type: core_1.Output
}], baselayerchangeEvent: [{
type: core_1.Output,
args: ["baselayerchange"]
}], overlayaddEvent: [{
type: core_1.Output,
args: ["overlayadd"]
}], overlayremoveEvent: [{
type: core_1.Output,
args: ["overlayremove"]
}], layeraddEvent: [{
type: core_1.Output,
args: ["layeradd"]
}], layerremoveEvent: [{
type: core_1.Output,
args: ["layerremove"]
}], zoomlevelschangeEvent: [{
type: core_1.Output,
args: ["zoomlevelschange"]
}], resizeEvent: [{
type: core_1.Output,
args: ["resize"]
}], unloadEvent: [{
type: core_1.Output,
args: ["unload"]
}], viewresetEvent: [{
type: core_1.Output,
args: ["viewreset"]
}], loadEvent: [{
type: core_1.Output,
args: ["load"]
}], zoomstartEvent: [{
type: core_1.Output,
args: ["zoomstart"]
}], movestartEvent: [{
type: core_1.Output,
args: ["movestart"]
}], zoomEvent: [{
type: core_1.Output,
args: ["zoom"]
}], moveEvent: [{
type: core_1.Output,
args: ["move"]
}], zoomendEvent: [{
type: core_1.Output,
args: ["zoomend"]
}], moveendEvent: [{
type: core_1.Output,
args: ["moveend"]
}], boxzoomstartEvent: [{
type: core_1.Output,
args: ["boxzoomstart"]
}], boxzoomendEvent: [{
type: core_1.Output,
args: ["boxzoomend"]
}], popupopenEvent: [{
type: core_1.Output,
args: ["popupopen"]
}], popupcloseEvent: [{
type: core_1.Output,
args: ["popupclose"]
}], autopanstartEvent: [{
type: core_1.Output,
args: ["autopanstart"]
}], tooltipopenEvent: [{
type: core_1.Output,
args: ["tooltipopen"]
}], tooltipcloseEvent: [{
type: core_1.Output,
args: ["tooltipclose"]
}], clickEvent: [{
type: core_1.Output,
args: ["click"]
}], dblclickEvent: [{
type: core_1.Output,
args: ["dblclick"]
}], mousedownEvent: [{
type: core_1.Output,
args: ["mousedown"]
}], mouseupEvent: [{
type: core_1.Output,
args: ["mouseup"]
}], mouseoverEvent: [{
type: core_1.Output,
args: ["mouseover"]
}], mouseoutEvent: [{
type: core_1.Output,
args: ["mouseout"]
}], mousemoveEvent: [{
type: core_1.Output,
args: ["mousemove"]
}], contextmenuEvent: [{
type: core_1.Output,
args: ["contextmenu"]
}], keypressEvent: [{
type: core_1.Output,
args: ["keypress"]
}], preclickEvent: [{
type: core_1.Output,
args: ["preclick"]
}], zoomanimEvent: [{
type: core_1.Output,
args: ["zoomanim"]
}], zoom: [{
type: core_1.Input
}], lat: [{
type: core_1.Input
}], lng: [{
type: core_1.Input
}], minZoom: [{
type: core_1.Input
}], maxZoom: [{
type: core_1.Input
}], crs: [{
type: core_1.Input
}], maxBounds: [{
type: core_1.Input
}], closePopupOnClick: [{
type: core_1.Input
}], zoomSnap: [{
type: core_1.Input
}], zoomDelta: [{
type: core_1.Input
}], trackResize: [{
type: core_1.Input
}], boxZoomEnabled: [{
type: core_1.Input
}], doubleClickZoomEnabled: [{
type: core_1.Input
}], draggingEnabled: [{
type: core_1.Input
}], fadeAnimation: [{
type: core_1.Input
}], markerZoomAnimation: [{
type: core_1.Input
}], transform3DLimit: [{
type: core_1.Input
}], zoomAnimation: [{
type: core_1.Input
}], zoomAnimationThreshold: [{
type: core_1.Input
}], inertia: [{
type: core_1.Input
}], inertiaDeceleration: [{
type: core_1.Input
}], inertiaMaxSpeed: [{
type: core_1.Input
}], easeLinearity: [{
type: core_1.Input
}], worldCopyJump: [{
type: core_1.Input
}], maxBoundsViscosity: [{
type: core_1.Input
}], keyboardEnabled: [{
type: core_1.Input
}], keyboardPanDelta: [{
type: core_1.Input
}], scrollWheelZoomEnabled: [{
type: core_1.Input
}], wheelDebounceTime: [{
type: core_1.Input
}], wheelPxPerZoomLevel: [{
type: core_1.Input
}], tapEnabled: [{
type: core_1.Input
}], tapTolerance: [{
type: core_1.Input
}], bounceAtZoomLimits: [{
type: core_1.Input
}], touchZoomEnabled: [{
type: core_1.Input
}] }); })();
//# sourceMappingURL=map.component.js.map