@geosdi/ngx-leaflet-minimap-plugin 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/geosdi-ngx-leaflet-minimap-plugin.umd.js +10 -3
- package/bundles/geosdi-ngx-leaflet-minimap-plugin.umd.js.map +1 -1
- package/esm2015/lib/ngx-leaflet-minimap-plugin.service.js +11 -4
- package/fesm2015/geosdi-ngx-leaflet-minimap-plugin.js +10 -3
- package/fesm2015/geosdi-ngx-leaflet-minimap-plugin.js.map +1 -1
- package/lib/ngx-leaflet-minimap-plugin.service.d.ts +9 -0
- package/package.json +1 -1
|
@@ -72,6 +72,13 @@
|
|
|
72
72
|
this.minZoom = minZoom;
|
|
73
73
|
return this;
|
|
74
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* @param layer
|
|
77
|
+
*/
|
|
78
|
+
NgxLeafletMinimapPluginService.prototype.changeLayer = function (layer) {
|
|
79
|
+
this.layer = layer;
|
|
80
|
+
this.miniMap.changeLayer(this.layer);
|
|
81
|
+
};
|
|
75
82
|
/**
|
|
76
83
|
*/
|
|
77
84
|
NgxLeafletMinimapPluginService.prototype.applyMiniMapPlugin = function () {
|
|
@@ -80,11 +87,11 @@
|
|
|
80
87
|
alert('Impossibile aggiungere il plugin mouse cursor');
|
|
81
88
|
}
|
|
82
89
|
else {
|
|
83
|
-
|
|
84
|
-
miniMap.on('minimize', function () {
|
|
90
|
+
this.miniMap = new MiniMap__default["default"](this.layer, { toggleDisplay: this.toogle }).addTo(this.map);
|
|
91
|
+
this.miniMap.on('minimize', function () {
|
|
85
92
|
_this.subjectMiniMapEvent$.next(false);
|
|
86
93
|
});
|
|
87
|
-
miniMap.on('restore', function () {
|
|
94
|
+
this.miniMap.on('restore', function () {
|
|
88
95
|
_this.subjectMiniMapEvent$.next(true);
|
|
89
96
|
});
|
|
90
97
|
setTimeout(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geosdi-ngx-leaflet-minimap-plugin.umd.js","sources":["../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.service.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.module.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/public-api.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/geosdi-ngx-leaflet-minimap-plugin.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport MiniMap from 'leaflet-minimap';\nimport {Subject} from 'rxjs';\nimport * as L from 'leaflet';\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxLeafletMinimapPluginService {\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param toogle\n */\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService;\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n */\n applyMiniMapPlugin(): void;\n\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService{\n\n private map: any;\n private minZoom: number = 0;\n private maxZoom: number = 13;\n private layer: any = new L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {minZoom: this.minZoom, maxZoom: this.maxZoom});\n private toogle: boolean = true;\n subjectMiniMapEvent$ = new Subject<boolean>();\n subjectChangeLayer$ = new Subject<any>();\n\n constructor() {\n this.subjectChangeLayer$.subscribe((theLayer: any) => this.layer = theLayer);\n }\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService {\n this.map = map\n return this;\n }\n\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService {\n this.toogle = toogle\n return this;\n }\n\n /**\n *\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService {\n this.layer = layer;\n return this;\n }\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService {\n this.maxZoom = maxZoom;\n return this;\n }\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService {\n this.minZoom = minZoom;\n return this;\n }\n\n /**\n */\n applyMiniMapPlugin(): void {\n if (!this.map) {\n alert('Impossibile aggiungere il plugin mouse cursor');\n } else {\n
|
|
1
|
+
{"version":3,"file":"geosdi-ngx-leaflet-minimap-plugin.umd.js","sources":["../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.service.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.module.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/public-api.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/geosdi-ngx-leaflet-minimap-plugin.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport MiniMap from 'leaflet-minimap';\nimport {Subject} from 'rxjs';\nimport * as L from 'leaflet';\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxLeafletMinimapPluginService {\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param toogle\n */\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService;\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n */\n applyMiniMapPlugin(): void;\n\n /**\n * @param layer\n */\n changeLayer(layer: any): void;\n\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService{\n\n private map: any;\n private minZoom: number = 0;\n private maxZoom: number = 13;\n private layer: any = new L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {minZoom: this.minZoom, maxZoom: this.maxZoom});\n private toogle: boolean = true;\n subjectMiniMapEvent$ = new Subject<boolean>();\n subjectChangeLayer$ = new Subject<any>();\n private miniMap: any;\n\n constructor() {\n this.subjectChangeLayer$.subscribe((theLayer: any) => this.layer = theLayer);\n }\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService {\n this.map = map\n return this;\n }\n\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService {\n this.toogle = toogle\n return this;\n }\n\n /**\n *\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService {\n this.layer = layer;\n return this;\n }\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService {\n this.maxZoom = maxZoom;\n return this;\n }\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService {\n this.minZoom = minZoom;\n return this;\n }\n\n /**\n * @param layer\n */\n changeLayer(layer: any): void {\n this.layer = layer;\n this.miniMap.changeLayer(this.layer);\n }\n\n /**\n */\n applyMiniMapPlugin(): void {\n if (!this.map) {\n alert('Impossibile aggiungere il plugin mouse cursor');\n } else {\n this.miniMap = new MiniMap(this.layer, {toggleDisplay: this.toogle}).addTo(this.map);\n this.miniMap.on('minimize', () => {\n this.subjectMiniMapEvent$.next(false);\n });\n this.miniMap.on('restore', () => {\n this.subjectMiniMapEvent$.next(true);\n });\n setTimeout(() => {\n this.map.invalidateSize();\n }, 500)\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\n\n\n@NgModule({\n declarations: [\n ],\n imports: [\n ],\n exports: [\n ]\n})\nexport class NgxLeafletMinimapPluginModule { }\n","/*\n * Public API Surface of ngx-leaflet-minimap-plugin\n */\n\nexport * from './lib/ngx-leaflet-minimap-plugin.service';\nexport * from './lib/ngx-leaflet-minimap-plugin.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["L","Subject","MiniMap","Injectable","NgModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6DE;YAAA,iBAEC;YAVO,YAAO,GAAW,CAAC,CAAC;YACpB,YAAO,GAAW,EAAE,CAAC;YACrB,UAAK,GAAQ,IAAIA,YAAC,CAAC,SAAS,CAAC,oDAAoD,EAAE,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC,CAAC;YACnI,WAAM,GAAY,IAAI,CAAC;YAC/B,yBAAoB,GAAG,IAAIC,YAAO,EAAW,CAAC;YAC9C,wBAAmB,GAAG,IAAIA,YAAO,EAAO,CAAC;YAIvC,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,UAAC,QAAa,IAAK,OAAA,KAAI,CAAC,KAAK,GAAG,QAAQ,GAAA,CAAC,CAAC;SAC9E;;;;QAKD,gDAAO,GAAP,UAAQ,GAAQ;YACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;YACd,OAAO,IAAI,CAAC;SACb;QAED,0DAAiB,GAAjB,UAAkB,MAAe;YAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;YACpB,OAAO,IAAI,CAAC;SACb;;;;;QAMD,kDAAS,GAAT,UAAU,KAAU;YAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,OAAO,IAAI,CAAC;SACb;;;;QAKD,oDAAW,GAAX,UAAY,OAAe;YACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,OAAO,IAAI,CAAC;SACb;;;;QAKD,oDAAW,GAAX,UAAY,OAAe;YACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,O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class NgxLeafletMinimapPluginService {
|
|
|
46
46
|
this.minZoom = minZoom;
|
|
47
47
|
return this;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* @param layer
|
|
51
|
+
*/
|
|
52
|
+
changeLayer(layer) {
|
|
53
|
+
this.layer = layer;
|
|
54
|
+
this.miniMap.changeLayer(this.layer);
|
|
55
|
+
}
|
|
49
56
|
/**
|
|
50
57
|
*/
|
|
51
58
|
applyMiniMapPlugin() {
|
|
@@ -53,11 +60,11 @@ export class NgxLeafletMinimapPluginService {
|
|
|
53
60
|
alert('Impossibile aggiungere il plugin mouse cursor');
|
|
54
61
|
}
|
|
55
62
|
else {
|
|
56
|
-
|
|
57
|
-
miniMap.on('minimize', () => {
|
|
63
|
+
this.miniMap = new MiniMap(this.layer, { toggleDisplay: this.toogle }).addTo(this.map);
|
|
64
|
+
this.miniMap.on('minimize', () => {
|
|
58
65
|
this.subjectMiniMapEvent$.next(false);
|
|
59
66
|
});
|
|
60
|
-
miniMap.on('restore', () => {
|
|
67
|
+
this.miniMap.on('restore', () => {
|
|
61
68
|
this.subjectMiniMapEvent$.next(true);
|
|
62
69
|
});
|
|
63
70
|
setTimeout(() => {
|
|
@@ -74,4 +81,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
74
81
|
providedIn: 'root'
|
|
75
82
|
}]
|
|
76
83
|
}], ctorParameters: function () { return []; } });
|
|
77
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
84
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxlYWZsZXQtbWluaW1hcC1wbHVnaW4uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2dlb3NkaS9uZ3gtbGVhZmxldC1taW5pbWFwLXBsdWdpbi9zcmMvbGliL25neC1sZWFmbGV0LW1pbmltY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Ck7XG4gICAgICB9LCA1MDApXG4gICAgfVxuICB9XG59XG4iXX0=
|
|
@@ -47,6 +47,13 @@ class NgxLeafletMinimapPluginService {
|
|
|
47
47
|
this.minZoom = minZoom;
|
|
48
48
|
return this;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* @param layer
|
|
52
|
+
*/
|
|
53
|
+
changeLayer(layer) {
|
|
54
|
+
this.layer = layer;
|
|
55
|
+
this.miniMap.changeLayer(this.layer);
|
|
56
|
+
}
|
|
50
57
|
/**
|
|
51
58
|
*/
|
|
52
59
|
applyMiniMapPlugin() {
|
|
@@ -54,11 +61,11 @@ class NgxLeafletMinimapPluginService {
|
|
|
54
61
|
alert('Impossibile aggiungere il plugin mouse cursor');
|
|
55
62
|
}
|
|
56
63
|
else {
|
|
57
|
-
|
|
58
|
-
miniMap.on('minimize', () => {
|
|
64
|
+
this.miniMap = new MiniMap(this.layer, { toggleDisplay: this.toogle }).addTo(this.map);
|
|
65
|
+
this.miniMap.on('minimize', () => {
|
|
59
66
|
this.subjectMiniMapEvent$.next(false);
|
|
60
67
|
});
|
|
61
|
-
miniMap.on('restore', () => {
|
|
68
|
+
this.miniMap.on('restore', () => {
|
|
62
69
|
this.subjectMiniMapEvent$.next(true);
|
|
63
70
|
});
|
|
64
71
|
setTimeout(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geosdi-ngx-leaflet-minimap-plugin.js","sources":["../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.service.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.module.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/public-api.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/geosdi-ngx-leaflet-minimap-plugin.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport MiniMap from 'leaflet-minimap';\nimport {Subject} from 'rxjs';\nimport * as L from 'leaflet';\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxLeafletMinimapPluginService {\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param toogle\n */\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService;\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n */\n applyMiniMapPlugin(): void;\n\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService{\n\n private map: any;\n private minZoom: number = 0;\n private maxZoom: number = 13;\n private layer: any = new L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {minZoom: this.minZoom, maxZoom: this.maxZoom});\n private toogle: boolean = true;\n subjectMiniMapEvent$ = new Subject<boolean>();\n subjectChangeLayer$ = new Subject<any>();\n\n constructor() {\n this.subjectChangeLayer$.subscribe((theLayer: any) => this.layer = theLayer);\n }\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService {\n this.map = map\n return this;\n }\n\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService {\n this.toogle = toogle\n return this;\n }\n\n /**\n *\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService {\n this.layer = layer;\n return this;\n }\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService {\n this.maxZoom = maxZoom;\n return this;\n }\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService {\n this.minZoom = minZoom;\n return this;\n }\n\n /**\n */\n applyMiniMapPlugin(): void {\n if (!this.map) {\n alert('Impossibile aggiungere il plugin mouse cursor');\n } else {\n
|
|
1
|
+
{"version":3,"file":"geosdi-ngx-leaflet-minimap-plugin.js","sources":["../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.service.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.module.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/public-api.ts","../../../../projects/geosdi/ngx-leaflet-minimap-plugin/src/geosdi-ngx-leaflet-minimap-plugin.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport MiniMap from 'leaflet-minimap';\nimport {Subject} from 'rxjs';\nimport * as L from 'leaflet';\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxLeafletMinimapPluginService {\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param toogle\n */\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService;\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService;\n\n /**\n */\n applyMiniMapPlugin(): void;\n\n /**\n * @param layer\n */\n changeLayer(layer: any): void;\n\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService{\n\n private map: any;\n private minZoom: number = 0;\n private maxZoom: number = 13;\n private layer: any = new L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {minZoom: this.minZoom, maxZoom: this.maxZoom});\n private toogle: boolean = true;\n subjectMiniMapEvent$ = new Subject<boolean>();\n subjectChangeLayer$ = new Subject<any>();\n private miniMap: any;\n\n constructor() {\n this.subjectChangeLayer$.subscribe((theLayer: any) => this.layer = theLayer);\n }\n\n /**\n * @param map\n */\n withMap(map: any): NgxLeafletMinimapPluginService {\n this.map = map\n return this;\n }\n\n withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService {\n this.toogle = toogle\n return this;\n }\n\n /**\n *\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService {\n this.layer = layer;\n return this;\n }\n\n /**\n * @param maxZoom\n */\n withMaxZoom(maxZoom: number): NgxLeafletMinimapPluginService {\n this.maxZoom = maxZoom;\n return this;\n }\n\n /**\n * @param minZoom\n */\n withMinZoom(minZoom: number): NgxLeafletMinimapPluginService {\n this.minZoom = minZoom;\n return this;\n }\n\n /**\n * @param layer\n */\n changeLayer(layer: any): void {\n this.layer = layer;\n this.miniMap.changeLayer(this.layer);\n }\n\n /**\n */\n applyMiniMapPlugin(): void {\n if (!this.map) {\n alert('Impossibile aggiungere il plugin mouse cursor');\n } else {\n this.miniMap = new MiniMap(this.layer, {toggleDisplay: this.toogle}).addTo(this.map);\n this.miniMap.on('minimize', () => {\n this.subjectMiniMapEvent$.next(false);\n });\n this.miniMap.on('restore', () => {\n this.subjectMiniMapEvent$.next(true);\n });\n setTimeout(() => {\n this.map.invalidateSize();\n }, 500)\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\n\n\n@NgModule({\n declarations: [\n ],\n imports: [\n ],\n exports: [\n ]\n})\nexport class NgxLeafletMinimapPluginModule { }\n","/*\n * Public API Surface of ngx-leaflet-minimap-plugin\n */\n\nexport * from './lib/ngx-leaflet-minimap-plugin.service';\nexport * from './lib/ngx-leaflet-minimap-plugin.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAkDa,8BAA8B;IAWzC;QARQ,YAAO,GAAW,CAAC,CAAC;QACpB,YAAO,GAAW,EAAE,CAAC;QACrB,UAAK,GAAQ,IAAI,CAAC,CAAC,SAAS,CAAC,oDAAoD,EAAE,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI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AE;gBAC1B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACvC,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE;gBACzB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACtC,CAAC,CAAC;YACH,UAAU,CAAC;gBACT,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;aAC3B,EAAE,GAAG,CAAC,CAAA;SACR;KACF;;+IA9EU,8BAA8B;mJAA9B,8BAA8B,cAF7B,MAAM;4FAEP,8BAA8B;kBAH1C,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;MCrCY,6BAA6B;;8IAA7B,6BAA6B;+IAA7B,6BAA6B;+IAA7B,6BAA6B,YAL/B,EACR;4FAIU,6BAA6B;kBARzC,QAAQ;mBAAC;oBACR,YAAY,EAAE,EACb;oBACD,OAAO,EAAE,EACR;oBACD,OAAO,EAAE,EACR;iBACF;;;ACXD;;;;ACAA;;;;;;"}
|
|
@@ -28,6 +28,10 @@ export interface INgxLeafletMinimapPluginService {
|
|
|
28
28
|
/**
|
|
29
29
|
*/
|
|
30
30
|
applyMiniMapPlugin(): void;
|
|
31
|
+
/**
|
|
32
|
+
* @param layer
|
|
33
|
+
*/
|
|
34
|
+
changeLayer(layer: any): void;
|
|
31
35
|
}
|
|
32
36
|
export declare class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService {
|
|
33
37
|
private map;
|
|
@@ -37,6 +41,7 @@ export declare class NgxLeafletMinimapPluginService implements INgxLeafletMinima
|
|
|
37
41
|
private toogle;
|
|
38
42
|
subjectMiniMapEvent$: Subject<boolean>;
|
|
39
43
|
subjectChangeLayer$: Subject<any>;
|
|
44
|
+
private miniMap;
|
|
40
45
|
constructor();
|
|
41
46
|
/**
|
|
42
47
|
* @param map
|
|
@@ -56,6 +61,10 @@ export declare class NgxLeafletMinimapPluginService implements INgxLeafletMinima
|
|
|
56
61
|
* @param minZoom
|
|
57
62
|
*/
|
|
58
63
|
withMinZoom(minZoom: number): NgxLeafletMinimapPluginService;
|
|
64
|
+
/**
|
|
65
|
+
* @param layer
|
|
66
|
+
*/
|
|
67
|
+
changeLayer(layer: any): void;
|
|
59
68
|
/**
|
|
60
69
|
*/
|
|
61
70
|
applyMiniMapPlugin(): void;
|