@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
package/src/OpenStreet.ts CHANGED
@@ -1,123 +1,123 @@
1
- import { select as d3Select } from "d3-selection";
2
- import { tile as d3Tile } from "d3-tile";
3
- import { Layer } from "./Layer";
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
- tileProvider: { (): string; (_: string): OpenStreet };
114
- tileProvider_exists: () => boolean;
115
- }
116
- OpenStreet.prototype._class += " map_OpenStreet";
117
-
118
- OpenStreet.prototype.publish("tileProvider", "OpenStreetMap", "set", "Tile Provider", ["OpenStreetMap", "OpenStreetMap Hot", "MapQuest", "MapQuest Sat", "Stamen Watercolor", "OpenCycleMap"], { tags: ["Basic", "Shared"] });
119
-
120
- function stringify(scale, translate) {
121
- const k = scale / 256;
122
- return "translate(" + -constScale / 2 + "," + -constScale / 2 + ") scale(" + k + ")";
123
- }
1
+ import { select as d3Select } from "d3-selection";
2
+ import { tile as d3Tile } from "d3-tile";
3
+ import { Layer } from "./Layer";
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
+ tileProvider: { (): string; (_: string): OpenStreet };
114
+ tileProvider_exists: () => boolean;
115
+ }
116
+ OpenStreet.prototype._class += " map_OpenStreet";
117
+
118
+ OpenStreet.prototype.publish("tileProvider", "OpenStreetMap", "set", "Tile Provider", ["OpenStreetMap", "OpenStreetMap Hot", "MapQuest", "MapQuest Sat", "Stamen Watercolor", "OpenCycleMap"], { tags: ["Basic", "Shared"] });
119
+
120
+ function stringify(scale, translate) {
121
+ const k = scale / 256;
122
+ return "translate(" + -constScale / 2 + "," + -constScale / 2 + ") scale(" + k + ")";
123
+ }
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
+ }