@hpcc-js/map 2.79.3 → 2.79.5

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.
Files changed (89) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +88 -88
  3. package/TopoJSON/BR.json +122 -122
  4. package/TopoJSON/GB_idx.json +1 -1
  5. package/TopoJSON/IE_idx.json +1 -1
  6. package/TopoJSON/ND_idx.json +1 -1
  7. package/TopoJSON/countries.json +257 -257
  8. package/TopoJSON/us-counties.json +16550 -16550
  9. package/TopoJSON/us-states.json +458 -458
  10. package/dist/index.es6.js +49 -49
  11. package/dist/index.es6.js.map +1 -1
  12. package/dist/index.js +49 -49
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.min.js +1 -1
  15. package/dist/index.min.js.map +1 -1
  16. package/package.json +7 -7
  17. package/src/CanvasPinLayer.ts +99 -99
  18. package/src/CanvasPins.ts +396 -396
  19. package/src/Choropleth.css +27 -27
  20. package/src/Choropleth.ts +195 -195
  21. package/src/ChoroplethContinents.ts +13 -13
  22. package/src/ChoroplethCounties.ts +109 -109
  23. package/src/ChoroplethCountries.ts +100 -100
  24. package/src/ChoroplethStates.ts +104 -104
  25. package/src/ChoroplethStatesHeat.ts +8 -8
  26. package/src/GMap.css +16 -16
  27. package/src/GMap.ts +879 -879
  28. package/src/GMapCounties.ts +93 -93
  29. package/src/GMapGraph.ts +61 -61
  30. package/src/GMapHeat.ts +27 -27
  31. package/src/GMapLayered.ts +94 -94
  32. package/src/GMapPin.ts +115 -115
  33. package/src/GMapPinLine.ts +125 -125
  34. package/src/GeoHash.css +15 -15
  35. package/src/GeoHash.ts +125 -125
  36. package/src/Graph.css +10 -10
  37. package/src/Graph.ts +98 -98
  38. package/src/Graticule.css +13 -13
  39. package/src/Graticule.ts +90 -90
  40. package/src/Heat.css +2 -2
  41. package/src/Heat.ts +82 -82
  42. package/src/IChoropleth.ts +8 -8
  43. package/src/Layer.ts +90 -90
  44. package/src/Layered.css +19 -19
  45. package/src/Layered.ts +206 -206
  46. package/src/Lines.css +9 -9
  47. package/src/Lines.ts +75 -75
  48. package/src/OpenStreet.css +15 -15
  49. package/src/OpenStreet.ts +123 -123
  50. package/src/Pins.css +18 -18
  51. package/src/Pins.ts +319 -319
  52. package/src/Projection.ts +42 -42
  53. package/src/TestHeatMap.ts +8 -8
  54. package/src/TopoJSONChoropleth.ts +114 -114
  55. package/src/Utility.ts +482 -482
  56. package/src/__package__.ts +3 -3
  57. package/src/index.ts +34 -34
  58. package/src/leaflet/AlbersPR.ts +48 -48
  59. package/src/leaflet/Blank.ts +9 -9
  60. package/src/leaflet/Circles.ts +139 -139
  61. package/src/leaflet/ClusterCircles.css +26 -26
  62. package/src/leaflet/ClusterCircles.ts +88 -88
  63. package/src/leaflet/Countries.ts +43 -43
  64. package/src/leaflet/DrawLayer.ts +167 -167
  65. package/src/leaflet/FeatureLayer.ts +138 -138
  66. package/src/leaflet/GMap.ts +44 -44
  67. package/src/leaflet/HeatLayer.ts +77 -77
  68. package/src/leaflet/Icons.ts +60 -60
  69. package/src/leaflet/Leaflet.css +3 -3
  70. package/src/leaflet/Leaflet.ts +238 -238
  71. package/src/leaflet/MapBox.ts +35 -35
  72. package/src/leaflet/Markers.ts +109 -109
  73. package/src/leaflet/OpenStreet.ts +27 -27
  74. package/src/leaflet/Path.ts +138 -138
  75. package/src/leaflet/Pins.ts +73 -73
  76. package/src/leaflet/Polygons.ts +113 -113
  77. package/src/leaflet/Region.ts +138 -138
  78. package/src/leaflet/Text.ts +99 -99
  79. package/src/leaflet/TileLayer.ts +81 -81
  80. package/src/leaflet/TopoJSON.ts +146 -146
  81. package/src/leaflet/US.ts +15 -15
  82. package/src/leaflet/USCounties.ts +43 -43
  83. package/src/leaflet/USStates.ts +41 -41
  84. package/src/leaflet/World.css +3 -3
  85. package/src/leaflet/World.ts +171 -171
  86. package/src/leaflet/index.ts +18 -18
  87. package/src/test.ts +114 -114
  88. package/types/__package__.d.ts +2 -2
  89. package/types-3.4/__package__.d.ts +2 -2
@@ -1,238 +1,238 @@
1
- import { Button, HTMLWidget, IconBar, publish, Spacer, Widget } from "@hpcc-js/common";
2
- import { LatLngBounds, Map } from "@hpcc-js/leaflet-shim";
3
- import { AlbersLayer } from "./AlbersPR";
4
- import { BlankLayer } from "./Blank";
5
- import { GMapLayer } from "./GMap";
6
- import { MapBoxLayer } from "./MapBox";
7
- import { OpenStreetLayer } from "./OpenStreet";
8
- import { ILayer, TileLayer } from "./TileLayer";
9
-
10
- import "../../src/leaflet/Leaflet.css";
11
-
12
- export class Leaflet extends HTMLWidget {
13
-
14
- protected _leafletElement;
15
- private _leafletMap: Map;
16
-
17
- protected _iconBar = new IconBar()
18
- .buttons([
19
- new Button().faChar("fa-plus").tooltip("Zoom in")
20
- .on("click", () => {
21
- this.zoomPlus();
22
- }),
23
- new Button().faChar("fa-minus").tooltip("Zoom out")
24
- .on("click", () => {
25
- this.zoomMinus();
26
- }),
27
- new Spacer(),
28
- new Button().faChar("fa-arrows-alt").tooltip("Zoom to fit")
29
- .on("click", () => {
30
- this.zoomToFit();
31
- })
32
- ])
33
- ;
34
-
35
- _blankLayer = new BlankLayer();
36
- _albersLayer = new AlbersLayer();
37
- _mapBoxLayer = new MapBoxLayer();
38
- _openStreetLayer = new OpenStreetLayer();
39
- _gmapLayer = new GMapLayer();
40
-
41
- constructor() {
42
- super();
43
- this.baseLayer();
44
- }
45
-
46
- zoom() {
47
- return this._leafletMap.getZoom();
48
- }
49
-
50
- zoomPlus() {
51
- this._leafletMap.zoomIn();
52
- }
53
-
54
- zoomMinus() {
55
- this._leafletMap.zoomOut();
56
- }
57
-
58
- zoomToDefault() {
59
- this._leafletMap.flyTo({ lat: this.defaultLat(), lng: this.defaultLong() }, this.defaultZoom(), { animate: false });
60
- }
61
-
62
- zoomToFit() {
63
- let bounds: LatLngBounds;
64
- if (this.mapType() === "AlbersPR") {
65
- bounds = this._albersLayer.getBounds();
66
- } else {
67
- this.layers().filter(l => l.hasBounds()).forEach(layer => {
68
- if (!bounds) {
69
- bounds = layer.getBounds();
70
- } else {
71
- bounds.extend(layer.getBounds());
72
- }
73
- });
74
- }
75
- if (bounds && bounds.isValid()) {
76
- this._leafletMap.fitBounds(bounds, { maxZoom: 14 });
77
- } else {
78
- this.zoomToDefault();
79
- }
80
- }
81
-
82
- syncLayers(sLayers: ILayer[], domNode, element) {
83
- const added: ILayer[] = [...sLayers];
84
- const updated: ILayer[] = [];
85
- const removed: ILayer[] = [];
86
- this._leafletMap.eachLayer(layer => {
87
- const idx = added.indexOf((layer as any).__hpcc_layer);
88
- if (idx >= 0) {
89
- updated.push((layer as any).__hpcc_layer);
90
- added.splice(idx, 1);
91
- } else if ((layer as any).__hpcc_layer) {
92
- removed.push((layer as any).__hpcc_layer);
93
- }
94
- });
95
- added.forEach(sl => {
96
- sl.layerEnter(this._leafletMap);
97
- sl.layerUpdate(this._leafletMap);
98
- });
99
- updated.forEach(sl => {
100
- sl.layerUpdate(this._leafletMap);
101
- });
102
- removed.forEach(sl => {
103
- sl.layerExit(this._leafletMap);
104
- });
105
- }
106
-
107
- protected _owner: HTMLWidget;
108
- isLayer(): boolean {
109
- return this._owner !== undefined && this._owner !== this;
110
- }
111
-
112
- baseLayer(): BlankLayer | AlbersLayer | MapBoxLayer | OpenStreetLayer | GMapLayer {
113
- switch (this.mapType()) {
114
- case "AlbersPR":
115
- this.map(this._albersLayer);
116
- break;
117
- case "MapBox":
118
- this.map(this._mapBoxLayer);
119
- break;
120
- case "OpenStreet":
121
- this.map(this._openStreetLayer);
122
- break;
123
- case "Google":
124
- this.map(this._gmapLayer);
125
- break;
126
- case "None":
127
- default:
128
- this.map(this._blankLayer);
129
- break;
130
- }
131
- return this.map();
132
- }
133
-
134
- enter(domNode, element) {
135
- super.enter(domNode, element);
136
- element.style("position", "relative");
137
- this._leafletElement = element.append("div")
138
- .style("position", "absolute")
139
- .style("width", `${this.width()}px`)
140
- .style("height", `${this.height()}px`)
141
- ;
142
-
143
- this._iconBar.target(domNode);
144
- }
145
-
146
- private _prevCRS;
147
- update(domNode, element) {
148
- super.update(domNode, element);
149
- this._leafletElement
150
- .style("width", `${this.width()}px`)
151
- .style("height", `${this.height()}px`)
152
- ;
153
-
154
- const baseLayer = this.baseLayer();
155
- if (this._prevCRS !== baseLayer.crs()) {
156
- this._prevCRS = baseLayer.crs();
157
- if (this._leafletMap) {
158
- this.syncLayers([], domNode, element);
159
- this._leafletMap.remove();
160
- this._leafletElement.html("");
161
- }
162
- this._leafletMap = new Map(this._leafletElement.node(), {
163
- trackResize: false,
164
- zoomControl: false,
165
- zoomSnap: this.mapType() === "AlbersPR" ? 0.1 : 1,
166
- crs: baseLayer.crs(),
167
- maxZoom: (baseLayer as any).getMaxZoom ? (baseLayer as any).getMaxZoom() : 18
168
- });
169
- this._leafletMap.setView([this.defaultLat(), this.defaultLong()], this.defaultZoom());
170
- this._leafletMap["attributionControl"].setPrefix(baseLayer.attribution());
171
- this._leafletMap.on("zoomend", e => this.layers().forEach(layer => layer.zoomEnd(e)));
172
- this._leafletMap.on("moveend", e => this.layers().forEach(layer => layer.moveEnd(e)));
173
- this._leafletMap.on("viewreset", e => this.layers().forEach(layer => layer.viewReset(e)));
174
-
175
- this._renderCount = 0;
176
- }
177
- this.syncLayers([baseLayer, ...this.layers()], domNode, element);
178
- this._leafletMap.invalidateSize();
179
- if (this.autoZoomToFit()) {
180
- this._leafletMap.whenReady(function () {
181
- this.zoomToFit();
182
- }, this);
183
- }
184
- this._iconBar
185
- .visible(this.showToolbar())
186
- .render((w: IconBar) => {
187
- const bbox = w.getBBox();
188
- w.element()
189
- .style("z-index", 5000)
190
- .style("left", `${this.width() - bbox.width - 4}px`)
191
- ;
192
- })
193
- ;
194
- }
195
-
196
- exit(domNode, element) {
197
- this._iconBar.target(null);
198
- super.exit(domNode, element);
199
- }
200
-
201
- render(callback?: (w: Widget) => void): this {
202
- const promises = [this.baseLayer().init(), ...this.layers().map(l => l.init())];
203
- Promise.all(promises).then(() => {
204
- super.render(callback);
205
- });
206
- return this;
207
- }
208
- }
209
- Leaflet.prototype._class += " map_Leaflet";
210
-
211
- export interface Leaflet {
212
- showToolbar(): boolean;
213
- showToolbar(_: boolean): this;
214
- mapType(): "None" | "AlbersPR" | "MapBox" | "OpenStreet" | "Google";
215
- mapType(_: "None" | "AlbersPR" | "MapBox" | "OpenStreet" | "Google"): this;
216
- mapType_default(_: "None" | "AlbersPR" | "MapBox" | "OpenStreet" | "Google"): this;
217
- map(): TileLayer;
218
- map(_: TileLayer): this;
219
- layers(): ILayer[];
220
- layers(_: ILayer[]): this;
221
- layers_default(_: ILayer[]): this;
222
- defaultLat(): number;
223
- defaultLat(_: number): this;
224
- defaultLong(): number;
225
- defaultLong(_: number): this;
226
- defaultZoom(): number;
227
- defaultZoom(_: number): this;
228
- autoZoomToFit: publish<this, boolean>;
229
- }
230
-
231
- Leaflet.prototype.publish("showToolbar", true, "boolean", "Show toolbar", undefined, { hidden: (w: Leaflet) => w.isLayer() });
232
- Leaflet.prototype.publish("mapType", "Google", "set", "Base Layer Type", ["None", "AlbersPR", "MapBox", "OpenStreet", "Google"], { hidden: (w: Leaflet) => w.isLayer() });
233
- Leaflet.prototype.publish("map", null, "widget", "Base Layer", undefined, { internal: true });
234
- Leaflet.prototype.publish("layers", [], "propertyArray", "Layers", undefined, { hidden: (w: Leaflet) => w.isLayer() });
235
- Leaflet.prototype.publish("defaultLat", 42.877742, "number", "Center Latitude", undefined, { hidden: (w: Leaflet) => w.isLayer() });
236
- Leaflet.prototype.publish("defaultLong", -97.380979, "number", "Center Longitude", undefined, { hidden: (w: Leaflet) => w.isLayer() });
237
- Leaflet.prototype.publish("defaultZoom", 4, "number", "Zoom Level", undefined, { hidden: (w: Leaflet) => w.isLayer() });
238
- Leaflet.prototype.publish("autoZoomToFit", true, "boolean", "Auto zoom to fit Data", undefined, { hidden: (w: Leaflet) => w.isLayer() });
1
+ import { Button, HTMLWidget, IconBar, publish, Spacer, Widget } from "@hpcc-js/common";
2
+ import { LatLngBounds, Map } from "@hpcc-js/leaflet-shim";
3
+ import { AlbersLayer } from "./AlbersPR";
4
+ import { BlankLayer } from "./Blank";
5
+ import { GMapLayer } from "./GMap";
6
+ import { MapBoxLayer } from "./MapBox";
7
+ import { OpenStreetLayer } from "./OpenStreet";
8
+ import { ILayer, TileLayer } from "./TileLayer";
9
+
10
+ import "../../src/leaflet/Leaflet.css";
11
+
12
+ export class Leaflet extends HTMLWidget {
13
+
14
+ protected _leafletElement;
15
+ private _leafletMap: Map;
16
+
17
+ protected _iconBar = new IconBar()
18
+ .buttons([
19
+ new Button().faChar("fa-plus").tooltip("Zoom in")
20
+ .on("click", () => {
21
+ this.zoomPlus();
22
+ }),
23
+ new Button().faChar("fa-minus").tooltip("Zoom out")
24
+ .on("click", () => {
25
+ this.zoomMinus();
26
+ }),
27
+ new Spacer(),
28
+ new Button().faChar("fa-arrows-alt").tooltip("Zoom to fit")
29
+ .on("click", () => {
30
+ this.zoomToFit();
31
+ })
32
+ ])
33
+ ;
34
+
35
+ _blankLayer = new BlankLayer();
36
+ _albersLayer = new AlbersLayer();
37
+ _mapBoxLayer = new MapBoxLayer();
38
+ _openStreetLayer = new OpenStreetLayer();
39
+ _gmapLayer = new GMapLayer();
40
+
41
+ constructor() {
42
+ super();
43
+ this.baseLayer();
44
+ }
45
+
46
+ zoom() {
47
+ return this._leafletMap.getZoom();
48
+ }
49
+
50
+ zoomPlus() {
51
+ this._leafletMap.zoomIn();
52
+ }
53
+
54
+ zoomMinus() {
55
+ this._leafletMap.zoomOut();
56
+ }
57
+
58
+ zoomToDefault() {
59
+ this._leafletMap.flyTo({ lat: this.defaultLat(), lng: this.defaultLong() }, this.defaultZoom(), { animate: false });
60
+ }
61
+
62
+ zoomToFit() {
63
+ let bounds: LatLngBounds;
64
+ if (this.mapType() === "AlbersPR") {
65
+ bounds = this._albersLayer.getBounds();
66
+ } else {
67
+ this.layers().filter(l => l.hasBounds()).forEach(layer => {
68
+ if (!bounds) {
69
+ bounds = layer.getBounds();
70
+ } else {
71
+ bounds.extend(layer.getBounds());
72
+ }
73
+ });
74
+ }
75
+ if (bounds && bounds.isValid()) {
76
+ this._leafletMap.fitBounds(bounds, { maxZoom: 14 });
77
+ } else {
78
+ this.zoomToDefault();
79
+ }
80
+ }
81
+
82
+ syncLayers(sLayers: ILayer[], domNode, element) {
83
+ const added: ILayer[] = [...sLayers];
84
+ const updated: ILayer[] = [];
85
+ const removed: ILayer[] = [];
86
+ this._leafletMap.eachLayer(layer => {
87
+ const idx = added.indexOf((layer as any).__hpcc_layer);
88
+ if (idx >= 0) {
89
+ updated.push((layer as any).__hpcc_layer);
90
+ added.splice(idx, 1);
91
+ } else if ((layer as any).__hpcc_layer) {
92
+ removed.push((layer as any).__hpcc_layer);
93
+ }
94
+ });
95
+ added.forEach(sl => {
96
+ sl.layerEnter(this._leafletMap);
97
+ sl.layerUpdate(this._leafletMap);
98
+ });
99
+ updated.forEach(sl => {
100
+ sl.layerUpdate(this._leafletMap);
101
+ });
102
+ removed.forEach(sl => {
103
+ sl.layerExit(this._leafletMap);
104
+ });
105
+ }
106
+
107
+ protected _owner: HTMLWidget;
108
+ isLayer(): boolean {
109
+ return this._owner !== undefined && this._owner !== this;
110
+ }
111
+
112
+ baseLayer(): BlankLayer | AlbersLayer | MapBoxLayer | OpenStreetLayer | GMapLayer {
113
+ switch (this.mapType()) {
114
+ case "AlbersPR":
115
+ this.map(this._albersLayer);
116
+ break;
117
+ case "MapBox":
118
+ this.map(this._mapBoxLayer);
119
+ break;
120
+ case "OpenStreet":
121
+ this.map(this._openStreetLayer);
122
+ break;
123
+ case "Google":
124
+ this.map(this._gmapLayer);
125
+ break;
126
+ case "None":
127
+ default:
128
+ this.map(this._blankLayer);
129
+ break;
130
+ }
131
+ return this.map();
132
+ }
133
+
134
+ enter(domNode, element) {
135
+ super.enter(domNode, element);
136
+ element.style("position", "relative");
137
+ this._leafletElement = element.append("div")
138
+ .style("position", "absolute")
139
+ .style("width", `${this.width()}px`)
140
+ .style("height", `${this.height()}px`)
141
+ ;
142
+
143
+ this._iconBar.target(domNode);
144
+ }
145
+
146
+ private _prevCRS;
147
+ update(domNode, element) {
148
+ super.update(domNode, element);
149
+ this._leafletElement
150
+ .style("width", `${this.width()}px`)
151
+ .style("height", `${this.height()}px`)
152
+ ;
153
+
154
+ const baseLayer = this.baseLayer();
155
+ if (this._prevCRS !== baseLayer.crs()) {
156
+ this._prevCRS = baseLayer.crs();
157
+ if (this._leafletMap) {
158
+ this.syncLayers([], domNode, element);
159
+ this._leafletMap.remove();
160
+ this._leafletElement.html("");
161
+ }
162
+ this._leafletMap = new Map(this._leafletElement.node(), {
163
+ trackResize: false,
164
+ zoomControl: false,
165
+ zoomSnap: this.mapType() === "AlbersPR" ? 0.1 : 1,
166
+ crs: baseLayer.crs(),
167
+ maxZoom: (baseLayer as any).getMaxZoom ? (baseLayer as any).getMaxZoom() : 18
168
+ });
169
+ this._leafletMap.setView([this.defaultLat(), this.defaultLong()], this.defaultZoom());
170
+ this._leafletMap["attributionControl"].setPrefix(baseLayer.attribution());
171
+ this._leafletMap.on("zoomend", e => this.layers().forEach(layer => layer.zoomEnd(e)));
172
+ this._leafletMap.on("moveend", e => this.layers().forEach(layer => layer.moveEnd(e)));
173
+ this._leafletMap.on("viewreset", e => this.layers().forEach(layer => layer.viewReset(e)));
174
+
175
+ this._renderCount = 0;
176
+ }
177
+ this.syncLayers([baseLayer, ...this.layers()], domNode, element);
178
+ this._leafletMap.invalidateSize();
179
+ if (this.autoZoomToFit()) {
180
+ this._leafletMap.whenReady(function () {
181
+ this.zoomToFit();
182
+ }, this);
183
+ }
184
+ this._iconBar
185
+ .visible(this.showToolbar())
186
+ .render((w: IconBar) => {
187
+ const bbox = w.getBBox();
188
+ w.element()
189
+ .style("z-index", 5000)
190
+ .style("left", `${this.width() - bbox.width - 4}px`)
191
+ ;
192
+ })
193
+ ;
194
+ }
195
+
196
+ exit(domNode, element) {
197
+ this._iconBar.target(null);
198
+ super.exit(domNode, element);
199
+ }
200
+
201
+ render(callback?: (w: Widget) => void): this {
202
+ const promises = [this.baseLayer().init(), ...this.layers().map(l => l.init())];
203
+ Promise.all(promises).then(() => {
204
+ super.render(callback);
205
+ });
206
+ return this;
207
+ }
208
+ }
209
+ Leaflet.prototype._class += " map_Leaflet";
210
+
211
+ export interface Leaflet {
212
+ showToolbar(): boolean;
213
+ showToolbar(_: boolean): this;
214
+ mapType(): "None" | "AlbersPR" | "MapBox" | "OpenStreet" | "Google";
215
+ mapType(_: "None" | "AlbersPR" | "MapBox" | "OpenStreet" | "Google"): this;
216
+ mapType_default(_: "None" | "AlbersPR" | "MapBox" | "OpenStreet" | "Google"): this;
217
+ map(): TileLayer;
218
+ map(_: TileLayer): this;
219
+ layers(): ILayer[];
220
+ layers(_: ILayer[]): this;
221
+ layers_default(_: ILayer[]): this;
222
+ defaultLat(): number;
223
+ defaultLat(_: number): this;
224
+ defaultLong(): number;
225
+ defaultLong(_: number): this;
226
+ defaultZoom(): number;
227
+ defaultZoom(_: number): this;
228
+ autoZoomToFit: publish<this, boolean>;
229
+ }
230
+
231
+ Leaflet.prototype.publish("showToolbar", true, "boolean", "Show toolbar", undefined, { hidden: (w: Leaflet) => w.isLayer() });
232
+ Leaflet.prototype.publish("mapType", "Google", "set", "Base Layer Type", ["None", "AlbersPR", "MapBox", "OpenStreet", "Google"], { hidden: (w: Leaflet) => w.isLayer() });
233
+ Leaflet.prototype.publish("map", null, "widget", "Base Layer", undefined, { internal: true });
234
+ Leaflet.prototype.publish("layers", [], "propertyArray", "Layers", undefined, { hidden: (w: Leaflet) => w.isLayer() });
235
+ Leaflet.prototype.publish("defaultLat", 42.877742, "number", "Center Latitude", undefined, { hidden: (w: Leaflet) => w.isLayer() });
236
+ Leaflet.prototype.publish("defaultLong", -97.380979, "number", "Center Longitude", undefined, { hidden: (w: Leaflet) => w.isLayer() });
237
+ Leaflet.prototype.publish("defaultZoom", 4, "number", "Zoom Level", undefined, { hidden: (w: Leaflet) => w.isLayer() });
238
+ Leaflet.prototype.publish("autoZoomToFit", true, "boolean", "Auto zoom to fit Data", undefined, { hidden: (w: Leaflet) => w.isLayer() });
@@ -1,35 +1,35 @@
1
- import { Map, TileLayer as LeafletTileLayer } from "@hpcc-js/leaflet-shim";
2
- import { TileLayer } from "./TileLayer";
3
-
4
- declare const window: any;
5
-
6
- export class MapBoxLayer extends TileLayer {
7
-
8
- constructor() {
9
- super();
10
- }
11
-
12
- attribution(): string {
13
- return !window.__hpcc_mapbox_apikey ? "DEVELOPER USE ONLY (@hpcc-js)" : "";
14
- }
15
-
16
- getMaxZoom(): number {
17
- return 18;
18
- }
19
-
20
- layerEnter(map: Map) {
21
- super.layerEnter(map);
22
- // Default key should be in sync with packages/map-deck/src/Common.ts
23
- if (!window.__hpcc_mapbox_apikey) {
24
- console.warn("__hpcc_mapbox_apikey does not contain a valid API key, reverting to developers key (expect limited performance)");
25
- }
26
- const hpcc_mapbox_apikey = window.__hpcc_mapbox_apikey || "pk.eyJ1IjoibGVzY2htb28iLCJhIjoiY2psY2FqY3l3MDhqNDN3cDl1MzFmZnkwcCJ9.HRoFwmz1j80gyz18ruggqw";
27
- this.add(new LeafletTileLayer(`https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token=${hpcc_mapbox_apikey}`, {
28
- attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
29
- maxZoom: 18,
30
- id: "streets-v11",
31
- accessToken: hpcc_mapbox_apikey
32
- } as any));
33
- }
34
- }
35
- MapBoxLayer.prototype._class += " map_MapBoxLayer";
1
+ import { Map, TileLayer as LeafletTileLayer } from "@hpcc-js/leaflet-shim";
2
+ import { TileLayer } from "./TileLayer";
3
+
4
+ declare const window: any;
5
+
6
+ export class MapBoxLayer extends TileLayer {
7
+
8
+ constructor() {
9
+ super();
10
+ }
11
+
12
+ attribution(): string {
13
+ return !window.__hpcc_mapbox_apikey ? "DEVELOPER USE ONLY (@hpcc-js)" : "";
14
+ }
15
+
16
+ getMaxZoom(): number {
17
+ return 18;
18
+ }
19
+
20
+ layerEnter(map: Map) {
21
+ super.layerEnter(map);
22
+ // Default key should be in sync with packages/map-deck/src/Common.ts
23
+ if (!window.__hpcc_mapbox_apikey) {
24
+ console.warn("__hpcc_mapbox_apikey does not contain a valid API key, reverting to developers key (expect limited performance)");
25
+ }
26
+ const hpcc_mapbox_apikey = window.__hpcc_mapbox_apikey || "pk.eyJ1IjoibGVzY2htb28iLCJhIjoiY2psY2FqY3l3MDhqNDN3cDl1MzFmZnkwcCJ9.HRoFwmz1j80gyz18ruggqw";
27
+ this.add(new LeafletTileLayer(`https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token=${hpcc_mapbox_apikey}`, {
28
+ attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
29
+ maxZoom: 18,
30
+ id: "streets-v11",
31
+ accessToken: hpcc_mapbox_apikey
32
+ } as any));
33
+ }
34
+ }
35
+ MapBoxLayer.prototype._class += " map_MapBoxLayer";