jpf-mobx 1.0.80 → 1.0.81
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.
|
@@ -16,20 +16,20 @@ export class MapElement extends Element {
|
|
|
16
16
|
controls = new Array();
|
|
17
17
|
build() {
|
|
18
18
|
super.build();
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
21
|
-
|
|
19
|
+
const properties = this.properties;
|
|
20
|
+
if (!properties.center) {
|
|
21
|
+
properties.center = burtonville;
|
|
22
22
|
}
|
|
23
23
|
const options = {
|
|
24
|
-
renderer:
|
|
24
|
+
renderer: properties.renderer,
|
|
25
25
|
zoomControl: false
|
|
26
26
|
};
|
|
27
27
|
setTimeout(() => {
|
|
28
|
-
this.map = leaflet.map(this.element, options).setView(unwrap(
|
|
28
|
+
this.map = leaflet.map(this.element, options).setView(unwrap(properties.center), this.properties.zoom);
|
|
29
29
|
leaflet.control.zoom({
|
|
30
30
|
position: "topleft",
|
|
31
|
-
zoomInTitle:
|
|
32
|
-
zoomOutTitle:
|
|
31
|
+
zoomInTitle: properties.zoomInTitle,
|
|
32
|
+
zoomOutTitle: properties.zoomOutTitle
|
|
33
33
|
}).addTo(this.map);
|
|
34
34
|
if (this.properties.eventListeners) {
|
|
35
35
|
Object.keys(this.properties.eventListeners).forEach((key) => {
|
|
@@ -38,21 +38,21 @@ export class MapElement extends Element {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
this.setTileLayers(
|
|
42
|
-
this.setLayers(unwrap(
|
|
43
|
-
if (isSubscribable(
|
|
44
|
-
this.disposers.push(
|
|
41
|
+
this.setTileLayers(properties.tileLayers);
|
|
42
|
+
this.setLayers(unwrap(properties.layers));
|
|
43
|
+
if (isSubscribable(properties.layers)) {
|
|
44
|
+
this.disposers.push(properties.layers.subscribe((layers) => {
|
|
45
45
|
this.setLayers(layers);
|
|
46
46
|
}));
|
|
47
47
|
}
|
|
48
|
-
this.setControls(unwrap(
|
|
49
|
-
if (isSubscribable(
|
|
50
|
-
this.disposers.push(
|
|
48
|
+
this.setControls(unwrap(properties.controls));
|
|
49
|
+
if (isSubscribable(properties.controls)) {
|
|
50
|
+
this.disposers.push(properties.controls.subscribe((controls) => {
|
|
51
51
|
this.setControls(controls);
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
54
|
-
if (isSubscribable(
|
|
55
|
-
this.disposers.push(
|
|
54
|
+
if (isSubscribable(properties.center)) {
|
|
55
|
+
this.disposers.push(properties.center.subscribe((center) => {
|
|
56
56
|
this.map.panTo(center);
|
|
57
57
|
}));
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../../src/controls/leaflet/Map/Map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAiB,MAAM,+BAA+B,CAAC;AACtF,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAe,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAiB1F,MAAM,OAAO,UAAW,SAAQ,OAAuB;IACnD,YAAY,UAA0B;QAClC,KAAK,CACD;YACI,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,gBAAgB,CACxB,UAAU,EACV;gBACI,WAAW,EAAE,YAAY;aAC5B,CAEJ;SACJ,CACJ,CAAC;IACN,CAAC;IAEO,GAAG,CAAc;IACjB,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;IACpC,QAAQ,GAAG,IAAI,KAAK,EAAmB,CAAC;IAEhD,KAAK;QACD,KAAK,CAAC,KAAK,EAAE,CAAC;QAEd,MAAM,
|
|
1
|
+
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../../src/controls/leaflet/Map/Map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MA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;YAC5B,CAAC,CAAC,CAAC;SACN;IACL,CAAC;CACJ;AAED,MAAM,UAAU,UAAU,CAAC,UAA0B;IACjD,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAA6B,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAE3E,MAAM,OAAO,aAAc,SAAQ,UAAU;IACzC,YAAY,UAA0B;QAClC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ,CAAoB;IAC5B,MAAM,CAAsE;IAC5E,IAAI,CAAU;IACd,KAAK,CAAU;IACf,KAAK,CAAU;IACf,IAAI,CAAU;IACd,IAAI,CAAU;IACd,UAAU,CAA4B;IACtC,MAAM,CAA8D;IACpE,QAAQ,CAAkE;IAC1E,WAAW,CAAU;IACrB,YAAY,CAAU;CACzB;AAED,eAAe,CACX,aAAa,CAAC,SAAS,CAAC,WAAW,EACnC,UAAU,CACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -41,26 +41,26 @@ export class MapElement extends Element<IMapProperties> {
|
|
|
41
41
|
build(): void {
|
|
42
42
|
super.build();
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
if (!
|
|
46
|
-
|
|
44
|
+
const properties = this.properties;
|
|
45
|
+
if (!properties.center) {
|
|
46
|
+
properties.center = burtonville;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const options: leaflet.MapOptions = {
|
|
50
|
-
renderer:
|
|
50
|
+
renderer: properties.renderer,
|
|
51
51
|
zoomControl: false
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
//Leaflet can not handle rendering from an element not attached to the DOM
|
|
55
55
|
setTimeout(
|
|
56
56
|
() => {
|
|
57
|
-
this.map = leaflet.map(this.element, options).setView(unwrap(
|
|
57
|
+
this.map = leaflet.map(this.element, options).setView(unwrap(properties.center), this.properties.zoom);
|
|
58
58
|
|
|
59
59
|
//Add the language specific zoom element
|
|
60
60
|
leaflet.control.zoom({
|
|
61
61
|
position: "topleft",
|
|
62
|
-
zoomInTitle:
|
|
63
|
-
zoomOutTitle:
|
|
62
|
+
zoomInTitle: properties.zoomInTitle,
|
|
63
|
+
zoomOutTitle: properties.zoomOutTitle
|
|
64
64
|
}).addTo(this.map);
|
|
65
65
|
|
|
66
66
|
if (this.properties.eventListeners) {
|
|
@@ -74,38 +74,29 @@ export class MapElement extends Element<IMapProperties> {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
this.setTileLayers(
|
|
77
|
+
this.setTileLayers(properties.tileLayers);
|
|
78
78
|
|
|
79
|
-
this.setLayers(unwrap(
|
|
80
|
-
if (isSubscribable(
|
|
79
|
+
this.setLayers(unwrap(properties.layers));
|
|
80
|
+
if (isSubscribable(properties.layers)) {
|
|
81
81
|
this.disposers.push(
|
|
82
|
-
|
|
82
|
+
properties.layers.subscribe((layers) => {
|
|
83
83
|
this.setLayers(layers);
|
|
84
84
|
})
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
this.setControls(unwrap(
|
|
89
|
-
if (isSubscribable(
|
|
88
|
+
this.setControls(unwrap(properties.controls));
|
|
89
|
+
if (isSubscribable(properties.controls)) {
|
|
90
90
|
this.disposers.push(
|
|
91
|
-
|
|
91
|
+
properties.controls.subscribe((controls) => {
|
|
92
92
|
this.setControls(controls);
|
|
93
93
|
})
|
|
94
|
-
//reaction(
|
|
95
|
-
// () => {
|
|
96
|
-
// return unwrap(viewModel.controls);
|
|
97
|
-
// },
|
|
98
|
-
// (controls) => {
|
|
99
|
-
// this.setControls(controls);
|
|
100
|
-
// }
|
|
101
|
-
//)
|
|
102
94
|
);
|
|
103
95
|
}
|
|
104
96
|
|
|
105
|
-
|
|
106
|
-
if (isSubscribable(viewModel.center)) {
|
|
97
|
+
if (isSubscribable(properties.center)) {
|
|
107
98
|
this.disposers.push(
|
|
108
|
-
|
|
99
|
+
properties.center.subscribe((center)=>{
|
|
109
100
|
this.map.panTo(center);
|
|
110
101
|
})
|
|
111
102
|
);
|