@hpcc-js/map 3.4.10 → 3.4.11

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 (96) 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.js +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.umd.cjs +1 -1
  13. package/dist/index.umd.cjs.map +1 -1
  14. package/package.json +7 -7
  15. package/src/CanvasPinLayer.ts +99 -99
  16. package/src/CanvasPins.ts +397 -397
  17. package/src/Choropleth.css +27 -27
  18. package/src/Choropleth.ts +203 -203
  19. package/src/ChoroplethContinents.ts +13 -13
  20. package/src/ChoroplethCounties.ts +111 -111
  21. package/src/ChoroplethCountries.ts +100 -100
  22. package/src/ChoroplethStates.ts +103 -103
  23. package/src/ChoroplethStatesHeat.ts +8 -8
  24. package/src/GMap.css +16 -16
  25. package/src/GMap.ts +880 -880
  26. package/src/GMapCounties.ts +93 -93
  27. package/src/GMapGraph.ts +61 -61
  28. package/src/GMapHeat.ts +27 -27
  29. package/src/GMapLayered.ts +94 -94
  30. package/src/GMapPin.ts +115 -115
  31. package/src/GMapPinLine.ts +138 -138
  32. package/src/GeoHash.css +15 -15
  33. package/src/GeoHash.ts +139 -139
  34. package/src/Graph.css +10 -10
  35. package/src/Graph.ts +98 -98
  36. package/src/Graticule.css +13 -13
  37. package/src/Graticule.ts +97 -97
  38. package/src/Heat.css +2 -2
  39. package/src/Heat.ts +87 -87
  40. package/src/IChoropleth.ts +8 -8
  41. package/src/Layer.ts +99 -99
  42. package/src/Layered.css +19 -19
  43. package/src/Layered.ts +206 -206
  44. package/src/Lines.css +9 -9
  45. package/src/Lines.ts +78 -78
  46. package/src/OpenStreet.css +15 -15
  47. package/src/OpenStreet.ts +126 -126
  48. package/src/Pins.css +18 -18
  49. package/src/Pins.ts +350 -350
  50. package/src/Projection.ts +42 -42
  51. package/src/TestHeatMap.ts +8 -8
  52. package/src/TopoJSONChoropleth.ts +125 -125
  53. package/src/Utility.ts +484 -484
  54. package/src/__package__.ts +3 -3
  55. package/src/index.ts +33 -33
  56. package/src/leaflet/AlbersPR.ts +48 -48
  57. package/src/leaflet/Blank.ts +9 -9
  58. package/src/leaflet/Circles.ts +139 -139
  59. package/src/leaflet/ClusterCircles.css +26 -26
  60. package/src/leaflet/ClusterCircles.ts +88 -88
  61. package/src/leaflet/Countries.ts +43 -43
  62. package/src/leaflet/DrawLayer.ts +167 -167
  63. package/src/leaflet/FeatureLayer.ts +138 -138
  64. package/src/leaflet/GMap.ts +44 -44
  65. package/src/leaflet/HeatLayer.ts +77 -77
  66. package/src/leaflet/Icons.ts +60 -60
  67. package/src/leaflet/Leaflet.css +3 -3
  68. package/src/leaflet/Leaflet.ts +239 -239
  69. package/src/leaflet/MapBox.ts +35 -35
  70. package/src/leaflet/Markers.ts +109 -109
  71. package/src/leaflet/OpenStreet.ts +27 -27
  72. package/src/leaflet/Path.ts +138 -138
  73. package/src/leaflet/Pins.ts +73 -73
  74. package/src/leaflet/Polygons.ts +113 -113
  75. package/src/leaflet/Region.ts +138 -138
  76. package/src/leaflet/Text.ts +99 -99
  77. package/src/leaflet/TileLayer.ts +81 -81
  78. package/src/leaflet/TopoJSON.ts +146 -146
  79. package/src/leaflet/US.ts +15 -15
  80. package/src/leaflet/USCounties.ts +43 -43
  81. package/src/leaflet/USStates.ts +41 -41
  82. package/src/leaflet/World.css +3 -3
  83. package/src/leaflet/World.ts +172 -172
  84. package/src/leaflet/index.ts +18 -18
  85. package/src/leaflet/leaflet-shim.ts +18 -18
  86. package/src/leaflet/plugins/BeautifyIcon.css +44 -44
  87. package/src/leaflet/plugins/BeautifyIcon.ts +190 -190
  88. package/src/leaflet/plugins/BeutifyIcon.licence +20 -20
  89. package/src/leaflet/plugins/D3SvgOverlay.css +3 -3
  90. package/src/leaflet/plugins/D3SvgOverlay.licence +20 -20
  91. package/src/leaflet/plugins/D3SvgOverlay.ts +175 -175
  92. package/src/leaflet/plugins/HeatLayer.license +21 -21
  93. package/src/leaflet/plugins/HeatLayer.ts +224 -224
  94. package/src/leaflet/plugins/Leaflet.GoogleMutant.ts +424 -424
  95. package/src/leaflet/plugins/lru_map.ts +352 -352
  96. package/src/test.ts +114 -114
package/src/OpenStreet.ts CHANGED
@@ -1,126 +1,126 @@
1
- import { select as d3Select } from "d3-selection";
2
- import { tile as d3Tile } from "d3-tile";
3
- import { Layer } from "./Layer.ts";
4
-
5
- // import * as Utility from "./Utility";
6
-
7
- const constScale = 1 << 12;
8
-
9
- import "../src/OpenStreet.css";
10
-
11
- export class OpenStreet extends Layer {
12
- static _copyrightText = "© OpenStreetMap contributors";
13
-
14
- _tile;
15
- _openStreet;
16
- _copyright;
17
- _copyrightBBox;
18
- _prevTileProvider;
19
- _zoomLayerID: number = 0;
20
- _prevZoomLevel;
21
-
22
- constructor() {
23
- super();
24
- this.autoScaleMode("none");
25
- }
26
-
27
- layerEnter(base, svgElement, domElement) {
28
- Layer.prototype.layerEnter.apply(this, arguments);
29
- base.zoomExtent([0.1, constScale * 4]);
30
-
31
- this._openStreet = svgElement.append("g");
32
- this._copyright = svgElement.append("text")
33
- .attr("x", -100)
34
- .attr("y", -100)
35
- .style("opacity", 0.5)
36
- .text(OpenStreet._copyrightText)
37
- ;
38
- this._copyrightBBox = this._copyright.node().getBBox();
39
- }
40
-
41
- layerUpdate(base) {
42
- this._tile = d3Tile()
43
- .size([base.width(), base.height()])
44
- .wrap(false);
45
- if (!this.visible()) {
46
- this._copyright.text("");
47
- } else {
48
- this._copyright
49
- .attr("x", base.width() - this._copyrightBBox.width - this._copyrightBBox.height / 2)
50
- .attr("y", base.height() - this._copyrightBBox.height / 2)
51
- .text(OpenStreet._copyrightText)
52
- ;
53
- }
54
- this.layerZoomed(base);
55
- }
56
-
57
- layerZoomed(base) {
58
- const scale = base.zoomScale();
59
- const transform = base.zoomTranslate();
60
- const tiles = this._tile
61
- .scale(scale * constScale)
62
- .translate(transform)()
63
- ;
64
-
65
- const tilesScale = tiles.scale / scale;
66
- const tilesTranslate = [
67
- tiles.translate[0] / tiles.scale,
68
- tiles.translate[1] / tiles.scale
69
- ];
70
-
71
- const zoomLevel = Math.round(tilesScale * 1000);
72
- if (this._prevZoomLevel !== zoomLevel) {
73
- this._prevZoomLevel = zoomLevel;
74
- this._zoomLayerID++;
75
- }
76
- const scaleG = this._openStreet.selectAll(".scaleG").data([this._zoomLayerID], d => d);
77
- const scaleGUpdate = scaleG.enter().append("g")
78
- .attr("class", "scaleG")
79
- .attr("transform", stringify(tilesScale, tilesTranslate))
80
- .merge(scaleG)
81
- ;
82
- scaleG.exit()
83
- .style("opacity", 1)
84
- .transition().duration(1000)
85
- .style("opacity", 0)
86
- .on("end", function (d) {
87
- d3Select(this).selectAll(".image")
88
- .attr("xlink:href", null)
89
- ;
90
- })
91
- .remove();
92
-
93
- const image = scaleGUpdate
94
- .selectAll(".image")
95
- .data(tiles, function (d) {
96
- return "" + d.x + "," + d.y;
97
- })
98
- ;
99
-
100
- image.enter().append("image")
101
- .attr("class", "image")
102
- .style("opacity", 0)
103
- .attr("x", function (d) { return d.tx; })
104
- .attr("y", function (d) { return d.ty; })
105
- .attr("width", 256)
106
- .attr("height", 256)
107
- .attr("xlink:href", function (d) { return "http://" + "abc"[d.y % 3] + ".tile.openstreetmap.org/" + d.z + "/" + d.x + "/" + d.y + ".png"; })
108
- .transition().duration(500)
109
- .style("opacity", 1)
110
- ;
111
- }
112
- }
113
- OpenStreet.prototype._class += " map_OpenStreet";
114
-
115
- export interface OpenStreet {
116
- tileProvider(): string;
117
- tileProvider(_: string): this;
118
- tileProvider_exists(): boolean;
119
- }
120
-
121
- OpenStreet.prototype.publish("tileProvider", "OpenStreetMap", "set", "Tile Provider", ["OpenStreetMap", "OpenStreetMap Hot", "MapQuest", "MapQuest Sat", "Stamen Watercolor", "OpenCycleMap"], { tags: ["Basic", "Shared"] });
122
-
123
- function stringify(scale, translate) {
124
- const k = scale / 256;
125
- return "translate(" + -constScale / 2 + "," + -constScale / 2 + ") scale(" + k + ")";
126
- }
1
+ import { select as d3Select } from "d3-selection";
2
+ import { tile as d3Tile } from "d3-tile";
3
+ import { Layer } from "./Layer.ts";
4
+
5
+ // import * as Utility from "./Utility";
6
+
7
+ const constScale = 1 << 12;
8
+
9
+ import "../src/OpenStreet.css";
10
+
11
+ export class OpenStreet extends Layer {
12
+ static _copyrightText = "© OpenStreetMap contributors";
13
+
14
+ _tile;
15
+ _openStreet;
16
+ _copyright;
17
+ _copyrightBBox;
18
+ _prevTileProvider;
19
+ _zoomLayerID: number = 0;
20
+ _prevZoomLevel;
21
+
22
+ constructor() {
23
+ super();
24
+ this.autoScaleMode("none");
25
+ }
26
+
27
+ layerEnter(base, svgElement, domElement) {
28
+ Layer.prototype.layerEnter.apply(this, arguments);
29
+ base.zoomExtent([0.1, constScale * 4]);
30
+
31
+ this._openStreet = svgElement.append("g");
32
+ this._copyright = svgElement.append("text")
33
+ .attr("x", -100)
34
+ .attr("y", -100)
35
+ .style("opacity", 0.5)
36
+ .text(OpenStreet._copyrightText)
37
+ ;
38
+ this._copyrightBBox = this._copyright.node().getBBox();
39
+ }
40
+
41
+ layerUpdate(base) {
42
+ this._tile = d3Tile()
43
+ .size([base.width(), base.height()])
44
+ .wrap(false);
45
+ if (!this.visible()) {
46
+ this._copyright.text("");
47
+ } else {
48
+ this._copyright
49
+ .attr("x", base.width() - this._copyrightBBox.width - this._copyrightBBox.height / 2)
50
+ .attr("y", base.height() - this._copyrightBBox.height / 2)
51
+ .text(OpenStreet._copyrightText)
52
+ ;
53
+ }
54
+ this.layerZoomed(base);
55
+ }
56
+
57
+ layerZoomed(base) {
58
+ const scale = base.zoomScale();
59
+ const transform = base.zoomTranslate();
60
+ const tiles = this._tile
61
+ .scale(scale * constScale)
62
+ .translate(transform)()
63
+ ;
64
+
65
+ const tilesScale = tiles.scale / scale;
66
+ const tilesTranslate = [
67
+ tiles.translate[0] / tiles.scale,
68
+ tiles.translate[1] / tiles.scale
69
+ ];
70
+
71
+ const zoomLevel = Math.round(tilesScale * 1000);
72
+ if (this._prevZoomLevel !== zoomLevel) {
73
+ this._prevZoomLevel = zoomLevel;
74
+ this._zoomLayerID++;
75
+ }
76
+ const scaleG = this._openStreet.selectAll(".scaleG").data([this._zoomLayerID], d => d);
77
+ const scaleGUpdate = scaleG.enter().append("g")
78
+ .attr("class", "scaleG")
79
+ .attr("transform", stringify(tilesScale, tilesTranslate))
80
+ .merge(scaleG)
81
+ ;
82
+ scaleG.exit()
83
+ .style("opacity", 1)
84
+ .transition().duration(1000)
85
+ .style("opacity", 0)
86
+ .on("end", function (d) {
87
+ d3Select(this).selectAll(".image")
88
+ .attr("xlink:href", null)
89
+ ;
90
+ })
91
+ .remove();
92
+
93
+ const image = scaleGUpdate
94
+ .selectAll(".image")
95
+ .data(tiles, function (d) {
96
+ return "" + d.x + "," + d.y;
97
+ })
98
+ ;
99
+
100
+ image.enter().append("image")
101
+ .attr("class", "image")
102
+ .style("opacity", 0)
103
+ .attr("x", function (d) { return d.tx; })
104
+ .attr("y", function (d) { return d.ty; })
105
+ .attr("width", 256)
106
+ .attr("height", 256)
107
+ .attr("xlink:href", function (d) { return "http://" + "abc"[d.y % 3] + ".tile.openstreetmap.org/" + d.z + "/" + d.x + "/" + d.y + ".png"; })
108
+ .transition().duration(500)
109
+ .style("opacity", 1)
110
+ ;
111
+ }
112
+ }
113
+ OpenStreet.prototype._class += " map_OpenStreet";
114
+
115
+ export interface OpenStreet {
116
+ tileProvider(): string;
117
+ tileProvider(_: string): this;
118
+ tileProvider_exists(): boolean;
119
+ }
120
+
121
+ OpenStreet.prototype.publish("tileProvider", "OpenStreetMap", "set", "Tile Provider", ["OpenStreetMap", "OpenStreetMap Hot", "MapQuest", "MapQuest Sat", "Stamen Watercolor", "OpenCycleMap"], { tags: ["Basic", "Shared"] });
122
+
123
+ function stringify(scale, translate) {
124
+ const k = scale / 256;
125
+ return "translate(" + -constScale / 2 + "," + -constScale / 2 + ") scale(" + k + ")";
126
+ }
package/src/Pins.css CHANGED
@@ -1,18 +1,18 @@
1
- .map_Layered .pin > path {
2
- cursor: pointer;
3
- stroke: #000000;
4
- }
5
-
6
- .map_Layered .pin.selected > path {
7
- stroke-width: 1px;
8
- stroke: red;
9
- }
10
-
11
- .map_Layered .pin.over > path {
12
- stroke: orange;
13
- }
14
-
15
- .map_Layered .pin.selected.over > path {
16
- stroke-width: 1px;
17
- stroke: red;
18
- }
1
+ .map_Layered .pin > path {
2
+ cursor: pointer;
3
+ stroke: #000000;
4
+ }
5
+
6
+ .map_Layered .pin.selected > path {
7
+ stroke-width: 1px;
8
+ stroke: red;
9
+ }
10
+
11
+ .map_Layered .pin.over > path {
12
+ stroke: orange;
13
+ }
14
+
15
+ .map_Layered .pin.selected.over > path {
16
+ stroke-width: 1px;
17
+ stroke: red;
18
+ }