@geosdi/ngx-leaflet-minimap-plugin 1.1.7 → 2.0.0
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/README.md
CHANGED
|
@@ -10,9 +10,7 @@ with a fluent API.
|
|
|
10
10
|
|
|
11
11
|
Peer dependencies:
|
|
12
12
|
|
|
13
|
-
"@angular/
|
|
14
|
-
"@angular/core": ">=20.0.0",
|
|
15
|
-
"typescript": ">=5.0.0",
|
|
13
|
+
"@angular/core": ">=22.0.0",
|
|
16
14
|
"leaflet": ">=1.9.3",
|
|
17
15
|
"rxjs": ">=7.8.2",
|
|
18
16
|
"leaflet-minimap": ">=3.6.1"
|
|
@@ -22,6 +20,8 @@ Include `leaflet-minimap/dist/Control.MiniMap.min.css` for the minimap's frame a
|
|
|
22
20
|
## Usage
|
|
23
21
|
|
|
24
22
|
```typescript
|
|
23
|
+
import { inject } from "@angular/core";
|
|
24
|
+
import * as L from "leaflet";
|
|
25
25
|
import { NgxLeafletMinimapPluginService } from "@geosdi/ngx-leaflet-minimap-plugin";
|
|
26
26
|
|
|
27
27
|
const minimap = inject(NgxLeafletMinimapPluginService);
|
|
@@ -97,3 +97,17 @@ the minimap. The defaults are the service's, which differ from Leaflet-MiniMap's
|
|
|
97
97
|
minimap can disappear by itself, and re-appear when the view fits again.
|
|
98
98
|
- **The service is a singleton** (`providedIn: "root"`): the settings stay for the next call, and
|
|
99
99
|
each `applyMiniMapPlugin()` adds a new minimap, so call it once per map.
|
|
100
|
+
|
|
101
|
+
## Changes in 2.0.0
|
|
102
|
+
|
|
103
|
+
- **A major version** because the peer dependencies now ask for Angular 22: an application on an
|
|
104
|
+
older Angular can no longer install it. The API is unchanged unless a point below says otherwise.
|
|
105
|
+
- `typescript` is no longer a peer dependency: nothing in the package imports it.
|
|
106
|
+
- **The Angular peer dependencies are `>=22.0.0`**: the library is compiled and tested with
|
|
107
|
+
Angular 22 only, so it no longer claims to install on older versions.
|
|
108
|
+
- Compiled with Angular 22.
|
|
109
|
+
- `@angular/common` is no longer a peer dependency: nothing in the library imports it. The
|
|
110
|
+
`rxjs` range lost a stray leading space (`" >=7.8.2"`), and the keywords say "minimap" instead
|
|
111
|
+
of "base layer".
|
|
112
|
+
- The installation block of this README matches the new peer dependencies. The code is
|
|
113
|
+
unchanged.
|
|
@@ -1,227 +1,160 @@
|
|
|
1
|
-
import * as L from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import { Injectable } from
|
|
4
|
-
import MiniMap from
|
|
5
|
-
import { Subject } from
|
|
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
|
-
return this;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* @param theMapOptions
|
|
162
|
-
*/
|
|
163
|
-
withMapOptions(theMapOptions) {
|
|
164
|
-
this.mapOptions = theMapOptions;
|
|
165
|
-
return this;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* @param layer
|
|
169
|
-
*/
|
|
170
|
-
changeLayer(layer) {
|
|
171
|
-
this.layer = layer;
|
|
172
|
-
this._miniMap?.changeLayer(this.layer);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
*
|
|
176
|
-
*/
|
|
177
|
-
get minimap() {
|
|
178
|
-
return this._miniMap;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
*/
|
|
182
|
-
applyMiniMapPlugin() {
|
|
183
|
-
if (this.map) {
|
|
184
|
-
this._miniMap = new MiniMap(this.layer, {
|
|
185
|
-
position: this.position,
|
|
186
|
-
width: this.width,
|
|
187
|
-
height: this.height,
|
|
188
|
-
collapsedWidth: this.collapsedWidth,
|
|
189
|
-
collapsedHeight: this.collapsedHeight,
|
|
190
|
-
zoomLevelOffset: this.zoomLevelOffset,
|
|
191
|
-
zoomLevelFixed: this.zoomLevelFixed,
|
|
192
|
-
centerFixed: this.centerFixed,
|
|
193
|
-
zoomAnimation: this.zoomAnimation,
|
|
194
|
-
toggleDisplay: this.toogle,
|
|
195
|
-
autoToggleDisplay: this.autoToogleDisplay,
|
|
196
|
-
minimized: this.minimized,
|
|
197
|
-
strings: this.strings,
|
|
198
|
-
//mapOptions: this.mapOptions
|
|
199
|
-
}).addTo(this.map);
|
|
200
|
-
this._miniMap.on("minimize", () => {
|
|
201
|
-
this.subjectMiniMapEvent$.next(false);
|
|
202
|
-
});
|
|
203
|
-
this._miniMap.on("restore", () => {
|
|
204
|
-
this.subjectMiniMapEvent$.next(true);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgxLeafletMinimapPluginService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
209
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgxLeafletMinimapPluginService, providedIn: "root" }); }
|
|
210
|
-
}
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgxLeafletMinimapPluginService, decorators: [{
|
|
212
|
-
type: Injectable,
|
|
213
|
-
args: [{
|
|
214
|
-
providedIn: "root",
|
|
215
|
-
}]
|
|
216
|
-
}], ctorParameters: () => [] });
|
|
217
|
-
|
|
218
|
-
/*
|
|
219
|
-
* Public API Surface of ngx-leaflet-minimap-plugin
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Generated bundle index. Do not edit.
|
|
224
|
-
*/
|
|
225
|
-
|
|
1
|
+
import * as L from "leaflet";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Injectable } from "@angular/core";
|
|
4
|
+
import MiniMap from "leaflet-minimap";
|
|
5
|
+
import { Subject } from "rxjs";
|
|
6
|
+
var NgxLeafletMinimapPluginService = class NgxLeafletMinimapPluginService {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.subjectMiniMapEvent$ = new Subject();
|
|
9
|
+
this.subjectChangeLayer$ = new Subject();
|
|
10
|
+
this.layer = new L.TileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
|
11
|
+
minZoom: 0,
|
|
12
|
+
maxNativeZoom: 13,
|
|
13
|
+
maxZoom: 22,
|
|
14
|
+
attribution: "© <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" rel=\"noopener\">OpenStreetMap</a> contributors"
|
|
15
|
+
});
|
|
16
|
+
this.position = "bottomright";
|
|
17
|
+
this.toogle = true;
|
|
18
|
+
this.autoToogleDisplay = true;
|
|
19
|
+
this.height = 150;
|
|
20
|
+
this.width = 150;
|
|
21
|
+
this.collapsedHeight = 19;
|
|
22
|
+
this.collapsedWidth = 19;
|
|
23
|
+
this.minimized = false;
|
|
24
|
+
this.strings = {
|
|
25
|
+
hideText: "Nascondi",
|
|
26
|
+
showText: "Mostra"
|
|
27
|
+
};
|
|
28
|
+
this.zoomLevelOffset = -5;
|
|
29
|
+
this.subjectChangeLayer$.subscribe((theLayer) => this.layer = theLayer);
|
|
30
|
+
}
|
|
31
|
+
withMap(map) {
|
|
32
|
+
this.map = map;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
withToogleDisplay(toogle) {
|
|
36
|
+
this.toogle = toogle;
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
withAutoToogleDisplay(autoToogleDislay) {
|
|
40
|
+
this.autoToogleDisplay = autoToogleDislay;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
withLayer(layer) {
|
|
44
|
+
this.layer = layer;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
withPosition(position) {
|
|
48
|
+
this.position = position;
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
withHeight(height) {
|
|
52
|
+
this.height = height;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
withWidth(width) {
|
|
56
|
+
this.width = width;
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
withCenterFixed(centerFixed) {
|
|
60
|
+
this.centerFixed = centerFixed;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
withCollapseHeight(collapseHeight) {
|
|
64
|
+
this.collapsedHeight = collapseHeight;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
withCollapseWidth(collapseWidth) {
|
|
68
|
+
this.collapsedWidth = collapseWidth;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
withMimimized(minimized) {
|
|
72
|
+
this.minimized = minimized;
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
withStrings(strings) {
|
|
76
|
+
this.strings = strings;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
withZoomAnimation(zoomAnimation) {
|
|
80
|
+
this.zoomAnimation = zoomAnimation;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
withZoomLevelFixed(zoomLevelFixed) {
|
|
84
|
+
this.zoomLevelFixed = zoomLevelFixed;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
withZoomLevelOffset(zoomLevelOffset) {
|
|
88
|
+
this.zoomLevelOffset = zoomLevelOffset;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
withMapOptions(theMapOptions) {
|
|
92
|
+
this.mapOptions = theMapOptions;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
changeLayer(layer) {
|
|
96
|
+
this.layer = layer;
|
|
97
|
+
this._miniMap?.changeLayer(this.layer);
|
|
98
|
+
}
|
|
99
|
+
get minimap() {
|
|
100
|
+
return this._miniMap;
|
|
101
|
+
}
|
|
102
|
+
applyMiniMapPlugin() {
|
|
103
|
+
if (this.map) {
|
|
104
|
+
this._miniMap = new MiniMap(this.layer, {
|
|
105
|
+
position: this.position,
|
|
106
|
+
width: this.width,
|
|
107
|
+
height: this.height,
|
|
108
|
+
collapsedWidth: this.collapsedWidth,
|
|
109
|
+
collapsedHeight: this.collapsedHeight,
|
|
110
|
+
zoomLevelOffset: this.zoomLevelOffset,
|
|
111
|
+
zoomLevelFixed: this.zoomLevelFixed,
|
|
112
|
+
centerFixed: this.centerFixed,
|
|
113
|
+
zoomAnimation: this.zoomAnimation,
|
|
114
|
+
toggleDisplay: this.toogle,
|
|
115
|
+
autoToggleDisplay: this.autoToogleDisplay,
|
|
116
|
+
minimized: this.minimized,
|
|
117
|
+
strings: this.strings
|
|
118
|
+
}).addTo(this.map);
|
|
119
|
+
this._miniMap.on("minimize", () => {
|
|
120
|
+
this.subjectMiniMapEvent$.next(false);
|
|
121
|
+
});
|
|
122
|
+
this._miniMap.on("restore", () => {
|
|
123
|
+
this.subjectMiniMapEvent$.next(true);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
static {
|
|
128
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
129
|
+
minVersion: "12.0.0",
|
|
130
|
+
version: "22.2.4",
|
|
131
|
+
ngImport: i0,
|
|
132
|
+
type: NgxLeafletMinimapPluginService,
|
|
133
|
+
deps: [],
|
|
134
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
static {
|
|
138
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
139
|
+
minVersion: "12.0.0",
|
|
140
|
+
version: "22.2.4",
|
|
141
|
+
ngImport: i0,
|
|
142
|
+
type: NgxLeafletMinimapPluginService,
|
|
143
|
+
providedIn: "root"
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
148
|
+
minVersion: "12.0.0",
|
|
149
|
+
version: "22.2.4",
|
|
150
|
+
ngImport: i0,
|
|
151
|
+
type: NgxLeafletMinimapPluginService,
|
|
152
|
+
decorators: [{
|
|
153
|
+
type: Injectable,
|
|
154
|
+
args: [{ providedIn: "root" }]
|
|
155
|
+
}],
|
|
156
|
+
ctorParameters: () => []
|
|
157
|
+
});
|
|
226
158
|
export { NgxLeafletMinimapPluginService };
|
|
227
|
-
|
|
159
|
+
|
|
160
|
+
//# sourceMappingURL=geosdi-ngx-leaflet-minimap-plugin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geosdi-ngx-leaflet-minimap-plugin.mjs","sources":["../../../../projects/geosdi/leaflet/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.service.ts","../../../../projects/geosdi/leaflet/ngx-leaflet-minimap-plugin/src/index.ts","../../../../projects/geosdi/leaflet/ngx-leaflet-minimap-plugin/src/geosdi-ngx-leaflet-minimap-plugin.ts"],"sourcesContent":["//@ts-ignore\nimport * as L from \"leaflet\";\nimport { Injectable } from \"@angular/core\";\n//@ts-ignore\nimport MiniMap from \"leaflet-minimap\";\nimport { Subject } from \"rxjs\";\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxLeafletMinimapPluginService {\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 autoToogleDislay\n */\n withAutoToogleDisplay(\n autoToogleDislay: boolean,\n ): NgxLeafletMinimapPluginService;\n\n /**\n * @param position\n */\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): NgxLeafletMinimapPluginService;\n\n /**\n * @param height\n */\n withHeight(height: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param width\n */\n withWidth(width: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param collapseHeight\n */\n withCollapseHeight(collapseHeight: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param collapseWidth\n */\n withCollapseWidth(collapseWidth: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param zoomLevelOffset\n */\n withZoomLevelOffset(\n zoomLevelOffset: number,\n ): NgxLeafletMinimapPluginService;\n\n /**\n * @param zoomLevelOffset\n */\n withZoomLevelFixed(zoomLevelFixed: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param centerFixed\n */\n withCenterFixed(centerFixed: number[]): NgxLeafletMinimapPluginService;\n\n /**\n * @param zoomAnimation\n */\n withZoomAnimation(zoomAnimation: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param minimized\n */\n withMimimized(minimized: boolean): NgxLeafletMinimapPluginService;\n\n /**\n * @param strings\n */\n withStrings(strings: {\n hideText: string;\n showText: string;\n }): NgxLeafletMinimapPluginService;\n\n /**\n * @param theMapOptions\n */\n withMapOptions(theMapOptions: any): NgxLeafletMinimapPluginService;\n\n /**\n */\n applyMiniMapPlugin(): void;\n\n /**\n * @param layer\n */\n changeLayer(layer: any): void;\n}\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService {\n subjectMiniMapEvent$ = new Subject<boolean>();\n subjectChangeLayer$ = new Subject<any>();\n private map: any;\n /**\n * Lo sfondo di ripiego, per chi non passa `withLayer`.\n *\n * Chiede i tile di OSM come la loro\n * {@link https://operations.osmfoundation.org/policies/tiles/ usage policy}\n * pretende, che è la stessa regola del basemap in\n * `ngx-leaflet-layers-plugin` — e chi non la rispetta si vede rispondere\n * **403 con il tile «Access blocked»**, che a video non è un errore ma un\n * riquadro grigio, quindi si cerca il guasto nel codice che disegna :\n *\n * - **host singolo**, niente sottodomini `{s}` : quelli servivano a\n * moltiplicare le connessioni parallele di HTTP/1.1 verso server tenuti da\n * volontari, sono deprecati e oggi sono solo carico in più;\n * - **attribuzione cliccabile**, verso `openstreetmap.org/copyright`;\n * - **fin dove si vuole chiedere**, che è la coppia qui sotto.\n *\n * `maxNativeZoom` a 13 **non** è un limite di quanto si può zoomare : è fin\n * dove i tile si scaricano, e sopra Leaflet ingrandisce quelli che ha. Tenuto\n * basso di proposito — la minimappa è un riquadro da 150px, dove un tile z13\n * ingrandito non si distingue da uno z18 nuovo, e ogni livello in più sarebbe\n * un'altra griglia di richieste a quei server per niente. È il risparmio che\n * il vecchio `maxZoom: 13` otteneva, ma quello **nascondeva il layer** oltre\n * il 13 : su una mappa che zooma più in là — maplite in Agitec arriva a 30 —\n * la minimappa restava **bianca**, senza che niente lo dicesse.\n *\n * La minimappa raddoppia le richieste di una pagina, perché mostra lo stesso\n * sfondo della mappa grande : è il motivo per cui qui conta più che altrove.\n */\n private layer: any = new L.TileLayer(\n \"https://tile.openstreetmap.org/{z}/{x}/{y}.png\",\n {\n minZoom: 0,\n maxNativeZoom: 13,\n maxZoom: 22,\n attribution:\n '© <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" rel=\"noopener\">OpenStreetMap</a> contributors',\n },\n );\n private _miniMap: any;\n private position: string = \"bottomright\";\n private toogle: boolean = true;\n private autoToogleDisplay: boolean = true;\n private height: number = 150;\n private width: number = 150;\n private collapsedHeight: number = 19;\n private collapsedWidth: number = 19;\n private centerFixed: number[];\n private minimized: boolean = false;\n private strings: { hideText: string; showText: string } = {\n hideText: \"Nascondi\",\n showText: \"Mostra\",\n };\n private zoomAnimation: any;\n private zoomLevelFixed: number;\n private zoomLevelOffset: number = -5;\n private mapOptions: any;\n\n constructor() {\n this.subjectChangeLayer$.subscribe(\n (theLayer: any) => (this.layer = theLayer),\n );\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 * @param autoToogleDislay\n */\n withAutoToogleDisplay(\n autoToogleDislay: boolean,\n ): NgxLeafletMinimapPluginService {\n this.autoToogleDisplay = autoToogleDislay;\n return this;\n }\n\n /**\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService {\n this.layer = layer;\n return this;\n }\n\n /**\n * @param position\n */\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): NgxLeafletMinimapPluginService {\n this.position = position;\n return this;\n }\n\n /**\n * @param height\n */\n withHeight(height: number): NgxLeafletMinimapPluginService {\n this.height = height;\n return this;\n }\n\n /**\n * @param width\n */\n withWidth(width: number): NgxLeafletMinimapPluginService {\n this.width = width;\n return this;\n }\n\n /**\n * @param centerFixed\n */\n withCenterFixed(centerFixed: number[]): NgxLeafletMinimapPluginService {\n this.centerFixed = centerFixed;\n return this;\n }\n\n /**\n * @param collapseHeight\n */\n withCollapseHeight(collapseHeight: number): NgxLeafletMinimapPluginService {\n this.collapsedHeight = collapseHeight;\n return this;\n }\n\n /**\n * @param collapseWidth\n */\n withCollapseWidth(collapseWidth: number): NgxLeafletMinimapPluginService {\n this.collapsedWidth = collapseWidth;\n return this;\n }\n\n /**\n * @param minimized\n */\n withMimimized(minimized: boolean): NgxLeafletMinimapPluginService {\n this.minimized = minimized;\n return this;\n }\n\n withStrings(strings: {\n hideText: string;\n showText: string;\n }): NgxLeafletMinimapPluginService {\n this.strings = strings;\n return this;\n }\n\n /**\n * @param zoomAnimation\n */\n withZoomAnimation(zoomAnimation: any): NgxLeafletMinimapPluginService {\n this.zoomAnimation = zoomAnimation;\n return this;\n }\n\n /**\n * @param zoomLevelFixed\n */\n withZoomLevelFixed(zoomLevelFixed: number): NgxLeafletMinimapPluginService {\n this.zoomLevelFixed = zoomLevelFixed;\n return this;\n }\n\n /**\n * @param zoomLevelOffset\n */\n withZoomLevelOffset(\n zoomLevelOffset: number,\n ): NgxLeafletMinimapPluginService {\n this.zoomLevelOffset = zoomLevelOffset;\n return this;\n }\n\n /**\n * @param theMapOptions\n */\n withMapOptions(theMapOptions: any): NgxLeafletMinimapPluginService {\n this.mapOptions = theMapOptions;\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 */\n get minimap() {\n return this._miniMap;\n }\n\n /**\n */\n applyMiniMapPlugin(): void {\n if (this.map) {\n this._miniMap = new MiniMap(this.layer, {\n position: this.position,\n width: this.width,\n height: this.height,\n collapsedWidth: this.collapsedWidth,\n collapsedHeight: this.collapsedHeight,\n zoomLevelOffset: this.zoomLevelOffset,\n zoomLevelFixed: this.zoomLevelFixed,\n centerFixed: this.centerFixed,\n zoomAnimation: this.zoomAnimation,\n toggleDisplay: this.toogle,\n autoToggleDisplay: this.autoToogleDisplay,\n minimized: this.minimized,\n strings: this.strings,\n //mapOptions: this.mapOptions\n }).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 }\n }\n}\n","/*\n * Public API Surface of ngx-leaflet-minimap-plugin\n */\n\nexport * from \"./lib/ngx-leaflet-minimap-plugin.service\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nex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AE,IAAI,CAAC,MAAM;gBAC1B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,OAAO,EAAE,IAAI,CAAC,OAAO;;AAExB,aAAA,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAK;AAC9B,gBAAA,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC;AACzC,YAAA,CAAC,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAK;AAC7B,gBAAA,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;AACxC,YAAA,CAAC,CAAC;QACN;IACJ;iIAhPS,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cAF3B,MAAM,EAAA,CAAA,CAAA;;2FAET,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;ACjHD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"geosdi-ngx-leaflet-minimap-plugin.mjs","names":[],"sources":["../../../../projects/geosdi/leaflet/ngx-leaflet-minimap-plugin/src/lib/ngx-leaflet-minimap-plugin.service.ts"],"sourcesContent":["//@ts-ignore\nimport * as L from \"leaflet\";\nimport { Injectable } from \"@angular/core\";\n//@ts-ignore\nimport MiniMap from \"leaflet-minimap\";\nimport { Subject } from \"rxjs\";\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxLeafletMinimapPluginService {\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 autoToogleDislay\n */\n withAutoToogleDisplay(\n autoToogleDislay: boolean,\n ): NgxLeafletMinimapPluginService;\n\n /**\n * @param position\n */\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): NgxLeafletMinimapPluginService;\n\n /**\n * @param height\n */\n withHeight(height: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param width\n */\n withWidth(width: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param collapseHeight\n */\n withCollapseHeight(collapseHeight: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param collapseWidth\n */\n withCollapseWidth(collapseWidth: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param zoomLevelOffset\n */\n withZoomLevelOffset(\n zoomLevelOffset: number,\n ): NgxLeafletMinimapPluginService;\n\n /**\n * @param zoomLevelOffset\n */\n withZoomLevelFixed(zoomLevelFixed: number): NgxLeafletMinimapPluginService;\n\n /**\n * @param centerFixed\n */\n withCenterFixed(centerFixed: number[]): NgxLeafletMinimapPluginService;\n\n /**\n * @param zoomAnimation\n */\n withZoomAnimation(zoomAnimation: any): NgxLeafletMinimapPluginService;\n\n /**\n * @param minimized\n */\n withMimimized(minimized: boolean): NgxLeafletMinimapPluginService;\n\n /**\n * @param strings\n */\n withStrings(strings: {\n hideText: string;\n showText: string;\n }): NgxLeafletMinimapPluginService;\n\n /**\n * @param theMapOptions\n */\n withMapOptions(theMapOptions: any): NgxLeafletMinimapPluginService;\n\n /**\n */\n applyMiniMapPlugin(): void;\n\n /**\n * @param layer\n */\n changeLayer(layer: any): void;\n}\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService {\n subjectMiniMapEvent$ = new Subject<boolean>();\n subjectChangeLayer$ = new Subject<any>();\n private map: any;\n /**\n * Lo sfondo di ripiego, per chi non passa `withLayer`.\n *\n * Chiede i tile di OSM come la loro\n * {@link https://operations.osmfoundation.org/policies/tiles/ usage policy}\n * pretende, che è la stessa regola del basemap in\n * `ngx-leaflet-layers-plugin` — e chi non la rispetta si vede rispondere\n * **403 con il tile «Access blocked»**, che a video non è un errore ma un\n * riquadro grigio, quindi si cerca il guasto nel codice che disegna :\n *\n * - **host singolo**, niente sottodomini `{s}` : quelli servivano a\n * moltiplicare le connessioni parallele di HTTP/1.1 verso server tenuti da\n * volontari, sono deprecati e oggi sono solo carico in più;\n * - **attribuzione cliccabile**, verso `openstreetmap.org/copyright`;\n * - **fin dove si vuole chiedere**, che è la coppia qui sotto.\n *\n * `maxNativeZoom` a 13 **non** è un limite di quanto si può zoomare : è fin\n * dove i tile si scaricano, e sopra Leaflet ingrandisce quelli che ha. Tenuto\n * basso di proposito — la minimappa è un riquadro da 150px, dove un tile z13\n * ingrandito non si distingue da uno z18 nuovo, e ogni livello in più sarebbe\n * un'altra griglia di richieste a quei server per niente. È il risparmio che\n * il vecchio `maxZoom: 13` otteneva, ma quello **nascondeva il layer** oltre\n * il 13 : su una mappa che zooma più in là — maplite in Agitec arriva a 30 —\n * la minimappa restava **bianca**, senza che niente lo dicesse.\n *\n * La minimappa raddoppia le richieste di una pagina, perché mostra lo stesso\n * sfondo della mappa grande : è il motivo per cui qui conta più che altrove.\n */\n private layer: any = new L.TileLayer(\n \"https://tile.openstreetmap.org/{z}/{x}/{y}.png\",\n {\n minZoom: 0,\n maxNativeZoom: 13,\n maxZoom: 22,\n attribution:\n '© <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" rel=\"noopener\">OpenStreetMap</a> contributors',\n },\n );\n private _miniMap: any;\n private position: string = \"bottomright\";\n private toogle: boolean = true;\n private autoToogleDisplay: boolean = true;\n private height: number = 150;\n private width: number = 150;\n private collapsedHeight: number = 19;\n private collapsedWidth: number = 19;\n private centerFixed: number[];\n private minimized: boolean = false;\n private strings: { hideText: string; showText: string } = {\n hideText: \"Nascondi\",\n showText: \"Mostra\",\n };\n private zoomAnimation: any;\n private zoomLevelFixed: number;\n private zoomLevelOffset: number = -5;\n private mapOptions: any;\n\n constructor() {\n this.subjectChangeLayer$.subscribe(\n (theLayer: any) => (this.layer = theLayer),\n );\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 * @param autoToogleDislay\n */\n withAutoToogleDisplay(\n autoToogleDislay: boolean,\n ): NgxLeafletMinimapPluginService {\n this.autoToogleDisplay = autoToogleDislay;\n return this;\n }\n\n /**\n * @param layer\n */\n withLayer(layer: any): NgxLeafletMinimapPluginService {\n this.layer = layer;\n return this;\n }\n\n /**\n * @param position\n */\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): NgxLeafletMinimapPluginService {\n this.position = position;\n return this;\n }\n\n /**\n * @param height\n */\n withHeight(height: number): NgxLeafletMinimapPluginService {\n this.height = height;\n return this;\n }\n\n /**\n * @param width\n */\n withWidth(width: number): NgxLeafletMinimapPluginService {\n this.width = width;\n return this;\n }\n\n /**\n * @param centerFixed\n */\n withCenterFixed(centerFixed: number[]): NgxLeafletMinimapPluginService {\n this.centerFixed = centerFixed;\n return this;\n }\n\n /**\n * @param collapseHeight\n */\n withCollapseHeight(collapseHeight: number): NgxLeafletMinimapPluginService {\n this.collapsedHeight = collapseHeight;\n return this;\n }\n\n /**\n * @param collapseWidth\n */\n withCollapseWidth(collapseWidth: number): NgxLeafletMinimapPluginService {\n this.collapsedWidth = collapseWidth;\n return this;\n }\n\n /**\n * @param minimized\n */\n withMimimized(minimized: boolean): NgxLeafletMinimapPluginService {\n this.minimized = minimized;\n return this;\n }\n\n withStrings(strings: {\n hideText: string;\n showText: string;\n }): NgxLeafletMinimapPluginService {\n this.strings = strings;\n return this;\n }\n\n /**\n * @param zoomAnimation\n */\n withZoomAnimation(zoomAnimation: any): NgxLeafletMinimapPluginService {\n this.zoomAnimation = zoomAnimation;\n return this;\n }\n\n /**\n * @param zoomLevelFixed\n */\n withZoomLevelFixed(zoomLevelFixed: number): NgxLeafletMinimapPluginService {\n this.zoomLevelFixed = zoomLevelFixed;\n return this;\n }\n\n /**\n * @param zoomLevelOffset\n */\n withZoomLevelOffset(\n zoomLevelOffset: number,\n ): NgxLeafletMinimapPluginService {\n this.zoomLevelOffset = zoomLevelOffset;\n return this;\n }\n\n /**\n * @param theMapOptions\n */\n withMapOptions(theMapOptions: any): NgxLeafletMinimapPluginService {\n this.mapOptions = theMapOptions;\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 */\n get minimap() {\n return this._miniMap;\n }\n\n /**\n */\n applyMiniMapPlugin(): void {\n if (this.map) {\n this._miniMap = new MiniMap(this.layer, {\n position: this.position,\n width: this.width,\n height: this.height,\n collapsedWidth: this.collapsedWidth,\n collapsedHeight: this.collapsedHeight,\n zoomLevelOffset: this.zoomLevelOffset,\n zoomLevelFixed: this.zoomLevelFixed,\n centerFixed: this.centerFixed,\n zoomAnimation: this.zoomAnimation,\n toggleDisplay: this.toogle,\n autoToggleDisplay: this.autoToogleDisplay,\n minimized: this.minimized,\n strings: this.strings,\n //mapOptions: this.mapOptions\n }).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 }\n }\n}\n"],"mappings":";;;;;AAkHA,IAAa,iCAA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 -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geosdi/ngx-leaflet-minimap-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Service to add minimap for Leaflet Map",
|
|
5
5
|
"author": "Salvia Vito (vito.salvia@gmail.com)",
|
|
6
6
|
"keywords": [
|
|
@@ -9,18 +9,16 @@
|
|
|
9
9
|
"typescript",
|
|
10
10
|
"leaflet",
|
|
11
11
|
"map",
|
|
12
|
-
"
|
|
12
|
+
"minimap"
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"tslib": "^2.3.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@angular/
|
|
20
|
-
"@angular/core": ">=20.0.0",
|
|
21
|
-
"typescript": ">=5.0.0",
|
|
19
|
+
"@angular/core": ">=22.0.0",
|
|
22
20
|
"leaflet": ">=1.9.3",
|
|
23
|
-
"rxjs": "
|
|
21
|
+
"rxjs": ">=7.8.2",
|
|
24
22
|
"leaflet-minimap": ">=3.6.1"
|
|
25
23
|
},
|
|
26
24
|
"module": "fesm2022/geosdi-ngx-leaflet-minimap-plugin.mjs",
|
|
@@ -1,210 +1,206 @@
|
|
|
1
|
-
import { Subject } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
|
|
1
|
+
import { Subject } from "rxjs";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
4
3
|
/**
|
|
5
4
|
* @author Vito Salvia - CNR IMAA geoSDI Group
|
|
6
5
|
* @email vito.salvia@gmail.com
|
|
7
6
|
*/
|
|
8
|
-
interface INgxLeafletMinimapPluginService {
|
|
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
|
-
|
|
7
|
+
export interface INgxLeafletMinimapPluginService {
|
|
8
|
+
/**
|
|
9
|
+
* @param map
|
|
10
|
+
*/
|
|
11
|
+
withMap(map: any): NgxLeafletMinimapPluginService;
|
|
12
|
+
/**
|
|
13
|
+
* @param layer
|
|
14
|
+
*/
|
|
15
|
+
withLayer(layer: any): NgxLeafletMinimapPluginService;
|
|
16
|
+
/**
|
|
17
|
+
* @param toogle
|
|
18
|
+
*/
|
|
19
|
+
withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService;
|
|
20
|
+
/**
|
|
21
|
+
* @param autoToogleDislay
|
|
22
|
+
*/
|
|
23
|
+
withAutoToogleDisplay(autoToogleDislay: boolean): NgxLeafletMinimapPluginService;
|
|
24
|
+
/**
|
|
25
|
+
* @param position
|
|
26
|
+
*/
|
|
27
|
+
withPosition(position: "topleft" | "topright" | "bottomleft" | "bottomright"): NgxLeafletMinimapPluginService;
|
|
28
|
+
/**
|
|
29
|
+
* @param height
|
|
30
|
+
*/
|
|
31
|
+
withHeight(height: number): NgxLeafletMinimapPluginService;
|
|
32
|
+
/**
|
|
33
|
+
* @param width
|
|
34
|
+
*/
|
|
35
|
+
withWidth(width: number): NgxLeafletMinimapPluginService;
|
|
36
|
+
/**
|
|
37
|
+
* @param collapseHeight
|
|
38
|
+
*/
|
|
39
|
+
withCollapseHeight(collapseHeight: number): NgxLeafletMinimapPluginService;
|
|
40
|
+
/**
|
|
41
|
+
* @param collapseWidth
|
|
42
|
+
*/
|
|
43
|
+
withCollapseWidth(collapseWidth: number): NgxLeafletMinimapPluginService;
|
|
44
|
+
/**
|
|
45
|
+
* @param zoomLevelOffset
|
|
46
|
+
*/
|
|
47
|
+
withZoomLevelOffset(zoomLevelOffset: number): NgxLeafletMinimapPluginService;
|
|
48
|
+
/**
|
|
49
|
+
* @param zoomLevelOffset
|
|
50
|
+
*/
|
|
51
|
+
withZoomLevelFixed(zoomLevelFixed: number): NgxLeafletMinimapPluginService;
|
|
52
|
+
/**
|
|
53
|
+
* @param centerFixed
|
|
54
|
+
*/
|
|
55
|
+
withCenterFixed(centerFixed: number[]): NgxLeafletMinimapPluginService;
|
|
56
|
+
/**
|
|
57
|
+
* @param zoomAnimation
|
|
58
|
+
*/
|
|
59
|
+
withZoomAnimation(zoomAnimation: any): NgxLeafletMinimapPluginService;
|
|
60
|
+
/**
|
|
61
|
+
* @param minimized
|
|
62
|
+
*/
|
|
63
|
+
withMimimized(minimized: boolean): NgxLeafletMinimapPluginService;
|
|
64
|
+
/**
|
|
65
|
+
* @param strings
|
|
66
|
+
*/
|
|
67
|
+
withStrings(strings: {
|
|
68
|
+
hideText: string;
|
|
69
|
+
showText: string;
|
|
70
|
+
}): NgxLeafletMinimapPluginService;
|
|
71
|
+
/**
|
|
72
|
+
* @param theMapOptions
|
|
73
|
+
*/
|
|
74
|
+
withMapOptions(theMapOptions: any): NgxLeafletMinimapPluginService;
|
|
75
|
+
/**
|
|
76
|
+
*/
|
|
77
|
+
applyMiniMapPlugin(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @param layer
|
|
80
|
+
*/
|
|
81
|
+
changeLayer(layer: any): void;
|
|
83
82
|
}
|
|
84
|
-
declare class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService {
|
|
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
|
-
export { NgxLeafletMinimapPluginService };
|
|
210
|
-
export type { INgxLeafletMinimapPluginService };
|
|
83
|
+
export declare class NgxLeafletMinimapPluginService implements INgxLeafletMinimapPluginService {
|
|
84
|
+
subjectMiniMapEvent$: Subject<boolean>;
|
|
85
|
+
subjectChangeLayer$: Subject<any>;
|
|
86
|
+
private map;
|
|
87
|
+
/**
|
|
88
|
+
* Lo sfondo di ripiego, per chi non passa `withLayer`.
|
|
89
|
+
*
|
|
90
|
+
* Chiede i tile di OSM come la loro
|
|
91
|
+
* {@link https://operations.osmfoundation.org/policies/tiles/ usage policy}
|
|
92
|
+
* pretende, che è la stessa regola del basemap in
|
|
93
|
+
* `ngx-leaflet-layers-plugin` — e chi non la rispetta si vede rispondere
|
|
94
|
+
* **403 con il tile «Access blocked»**, che a video non è un errore ma un
|
|
95
|
+
* riquadro grigio, quindi si cerca il guasto nel codice che disegna :
|
|
96
|
+
*
|
|
97
|
+
* - **host singolo**, niente sottodomini `{s}` : quelli servivano a
|
|
98
|
+
* moltiplicare le connessioni parallele di HTTP/1.1 verso server tenuti da
|
|
99
|
+
* volontari, sono deprecati e oggi sono solo carico in più;
|
|
100
|
+
* - **attribuzione cliccabile**, verso `openstreetmap.org/copyright`;
|
|
101
|
+
* - **fin dove si vuole chiedere**, che è la coppia qui sotto.
|
|
102
|
+
*
|
|
103
|
+
* `maxNativeZoom` a 13 **non** è un limite di quanto si può zoomare : è fin
|
|
104
|
+
* dove i tile si scaricano, e sopra Leaflet ingrandisce quelli che ha. Tenuto
|
|
105
|
+
* basso di proposito — la minimappa è un riquadro da 150px, dove un tile z13
|
|
106
|
+
* ingrandito non si distingue da uno z18 nuovo, e ogni livello in più sarebbe
|
|
107
|
+
* un'altra griglia di richieste a quei server per niente. È il risparmio che
|
|
108
|
+
* il vecchio `maxZoom: 13` otteneva, ma quello **nascondeva il layer** oltre
|
|
109
|
+
* il 13 : su una mappa che zooma più in là — maplite in Agitec arriva a 30 —
|
|
110
|
+
* la minimappa restava **bianca**, senza che niente lo dicesse.
|
|
111
|
+
*
|
|
112
|
+
* La minimappa raddoppia le richieste di una pagina, perché mostra lo stesso
|
|
113
|
+
* sfondo della mappa grande : è il motivo per cui qui conta più che altrove.
|
|
114
|
+
*/
|
|
115
|
+
private layer;
|
|
116
|
+
private _miniMap;
|
|
117
|
+
private position;
|
|
118
|
+
private toogle;
|
|
119
|
+
private autoToogleDisplay;
|
|
120
|
+
private height;
|
|
121
|
+
private width;
|
|
122
|
+
private collapsedHeight;
|
|
123
|
+
private collapsedWidth;
|
|
124
|
+
private centerFixed;
|
|
125
|
+
private minimized;
|
|
126
|
+
private strings;
|
|
127
|
+
private zoomAnimation;
|
|
128
|
+
private zoomLevelFixed;
|
|
129
|
+
private zoomLevelOffset;
|
|
130
|
+
private mapOptions;
|
|
131
|
+
constructor();
|
|
132
|
+
/**
|
|
133
|
+
* @param map
|
|
134
|
+
*/
|
|
135
|
+
withMap(map: any): NgxLeafletMinimapPluginService;
|
|
136
|
+
withToogleDisplay(toogle: boolean): NgxLeafletMinimapPluginService;
|
|
137
|
+
/**
|
|
138
|
+
* @param autoToogleDislay
|
|
139
|
+
*/
|
|
140
|
+
withAutoToogleDisplay(autoToogleDislay: boolean): NgxLeafletMinimapPluginService;
|
|
141
|
+
/**
|
|
142
|
+
* @param layer
|
|
143
|
+
*/
|
|
144
|
+
withLayer(layer: any): NgxLeafletMinimapPluginService;
|
|
145
|
+
/**
|
|
146
|
+
* @param position
|
|
147
|
+
*/
|
|
148
|
+
withPosition(position: "topleft" | "topright" | "bottomleft" | "bottomright"): NgxLeafletMinimapPluginService;
|
|
149
|
+
/**
|
|
150
|
+
* @param height
|
|
151
|
+
*/
|
|
152
|
+
withHeight(height: number): NgxLeafletMinimapPluginService;
|
|
153
|
+
/**
|
|
154
|
+
* @param width
|
|
155
|
+
*/
|
|
156
|
+
withWidth(width: number): NgxLeafletMinimapPluginService;
|
|
157
|
+
/**
|
|
158
|
+
* @param centerFixed
|
|
159
|
+
*/
|
|
160
|
+
withCenterFixed(centerFixed: number[]): NgxLeafletMinimapPluginService;
|
|
161
|
+
/**
|
|
162
|
+
* @param collapseHeight
|
|
163
|
+
*/
|
|
164
|
+
withCollapseHeight(collapseHeight: number): NgxLeafletMinimapPluginService;
|
|
165
|
+
/**
|
|
166
|
+
* @param collapseWidth
|
|
167
|
+
*/
|
|
168
|
+
withCollapseWidth(collapseWidth: number): NgxLeafletMinimapPluginService;
|
|
169
|
+
/**
|
|
170
|
+
* @param minimized
|
|
171
|
+
*/
|
|
172
|
+
withMimimized(minimized: boolean): NgxLeafletMinimapPluginService;
|
|
173
|
+
withStrings(strings: {
|
|
174
|
+
hideText: string;
|
|
175
|
+
showText: string;
|
|
176
|
+
}): NgxLeafletMinimapPluginService;
|
|
177
|
+
/**
|
|
178
|
+
* @param zoomAnimation
|
|
179
|
+
*/
|
|
180
|
+
withZoomAnimation(zoomAnimation: any): NgxLeafletMinimapPluginService;
|
|
181
|
+
/**
|
|
182
|
+
* @param zoomLevelFixed
|
|
183
|
+
*/
|
|
184
|
+
withZoomLevelFixed(zoomLevelFixed: number): NgxLeafletMinimapPluginService;
|
|
185
|
+
/**
|
|
186
|
+
* @param zoomLevelOffset
|
|
187
|
+
*/
|
|
188
|
+
withZoomLevelOffset(zoomLevelOffset: number): NgxLeafletMinimapPluginService;
|
|
189
|
+
/**
|
|
190
|
+
* @param theMapOptions
|
|
191
|
+
*/
|
|
192
|
+
withMapOptions(theMapOptions: any): NgxLeafletMinimapPluginService;
|
|
193
|
+
/**
|
|
194
|
+
* @param layer
|
|
195
|
+
*/
|
|
196
|
+
changeLayer(layer: any): void;
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
*/
|
|
200
|
+
get minimap(): any;
|
|
201
|
+
/**
|
|
202
|
+
*/
|
|
203
|
+
applyMiniMapPlugin(): void;
|
|
204
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxLeafletMinimapPluginService, never>;
|
|
205
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
206
|
+
}
|