@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
@@ -1,3 +1,3 @@
1
- export const PKG_NAME = "__PACKAGE_NAME__";
2
- export const PKG_VERSION = "__PACKAGE_VERSION__";
3
- export const BUILD_VERSION = "__BUILD_VERSION__";
1
+ export const PKG_NAME = "__PACKAGE_NAME__";
2
+ export const PKG_VERSION = "__PACKAGE_VERSION__";
3
+ export const BUILD_VERSION = "__BUILD_VERSION__";
package/src/index.ts CHANGED
@@ -1,33 +1,33 @@
1
- export * from "./__package__.ts";
2
- export * from "./CanvasPinLayer.ts";
3
- export * from "./CanvasPins.ts";
4
- export * from "./Choropleth.ts";
5
- export * from "./ChoroplethContinents.ts";
6
- export * from "./ChoroplethCounties.ts";
7
- export * from "./ChoroplethCountries.ts";
8
- export * from "./ChoroplethStates.ts";
9
- export * from "./ChoroplethStatesHeat.ts";
10
- export * from "./GeoHash.ts";
11
- export * from "./GMap.ts";
12
- export * from "./GMapCounties.ts";
13
- export * from "./GMapGraph.ts";
14
- export * from "./GMapHeat.ts";
15
- export * from "./GMapLayered.ts";
16
- export * from "./GMapPin.ts";
17
- export * from "./GMapPinLine.ts";
18
- export * from "./Graph.ts";
19
- export * from "./Graticule.ts";
20
- export * from "./Heat.ts";
21
- export * from "./IChoropleth.ts";
22
- export * from "./Layer.ts";
23
- export * from "./Layered.ts";
24
- export * from "./Lines.ts";
25
- export * from "./OpenStreet.ts";
26
- export * from "./Pins.ts";
27
- export * from "./Projection.ts";
28
- export * from "./TopoJSONChoropleth.ts";
29
-
30
- import * as Leaflet from "./leaflet/index.ts";
31
- export {
32
- Leaflet
33
- };
1
+ export * from "./__package__.ts";
2
+ export * from "./CanvasPinLayer.ts";
3
+ export * from "./CanvasPins.ts";
4
+ export * from "./Choropleth.ts";
5
+ export * from "./ChoroplethContinents.ts";
6
+ export * from "./ChoroplethCounties.ts";
7
+ export * from "./ChoroplethCountries.ts";
8
+ export * from "./ChoroplethStates.ts";
9
+ export * from "./ChoroplethStatesHeat.ts";
10
+ export * from "./GeoHash.ts";
11
+ export * from "./GMap.ts";
12
+ export * from "./GMapCounties.ts";
13
+ export * from "./GMapGraph.ts";
14
+ export * from "./GMapHeat.ts";
15
+ export * from "./GMapLayered.ts";
16
+ export * from "./GMapPin.ts";
17
+ export * from "./GMapPinLine.ts";
18
+ export * from "./Graph.ts";
19
+ export * from "./Graticule.ts";
20
+ export * from "./Heat.ts";
21
+ export * from "./IChoropleth.ts";
22
+ export * from "./Layer.ts";
23
+ export * from "./Layered.ts";
24
+ export * from "./Lines.ts";
25
+ export * from "./OpenStreet.ts";
26
+ export * from "./Pins.ts";
27
+ export * from "./Projection.ts";
28
+ export * from "./TopoJSONChoropleth.ts";
29
+
30
+ import * as Leaflet from "./leaflet/index.ts";
31
+ export {
32
+ Leaflet
33
+ };
@@ -1,48 +1,48 @@
1
- import { CRS, LatLng, LatLngBounds, Point, Transformation, Util } from "./leaflet-shim.ts";
2
- import { resolve } from "../Projection.ts";
3
- import { TileLayer } from "./TileLayer.ts";
4
-
5
- const projAlbers = resolve("Albers").scale(.5);
6
- const projAlbersUsaPr = resolve("AlbersUsaPr").scale(.5);
7
-
8
- const AlbersProjection = {
9
- project(latLng) {
10
- let point = projAlbersUsaPr([latLng.lng, latLng.lat]);
11
- if (!point) {
12
- point = projAlbers([latLng.lng, latLng.lat]);
13
- }
14
- return new Point(point[0], point[1]);
15
- },
16
- unproject(point) {
17
- if (!isNaN(point.x) && !isNaN(point.y)) {
18
- const latLng = projAlbers.invert([point.x, point.y]);
19
- return new LatLng(latLng[1], latLng[0]);
20
- } else {
21
- return new LatLng(0, 0);
22
- }
23
- }
24
- };
25
-
26
- const AlbersCRS = Util.extend({}, CRS, {
27
- projection: AlbersProjection,
28
- transformation: new Transformation(1, 0, 1, 0),
29
- infinite: true
30
- });
31
-
32
- export class AlbersLayer extends TileLayer {
33
-
34
- _crs = AlbersCRS;
35
-
36
- constructor() {
37
- super();
38
- }
39
-
40
- hasBounds() {
41
- return true;
42
- }
43
-
44
- getBounds() {
45
- return new LatLngBounds([20, -123], [49, -64]);
46
- }
47
- }
48
- AlbersLayer.prototype._class += " map_AlbersLayer";
1
+ import { CRS, LatLng, LatLngBounds, Point, Transformation, Util } from "./leaflet-shim.ts";
2
+ import { resolve } from "../Projection.ts";
3
+ import { TileLayer } from "./TileLayer.ts";
4
+
5
+ const projAlbers = resolve("Albers").scale(.5);
6
+ const projAlbersUsaPr = resolve("AlbersUsaPr").scale(.5);
7
+
8
+ const AlbersProjection = {
9
+ project(latLng) {
10
+ let point = projAlbersUsaPr([latLng.lng, latLng.lat]);
11
+ if (!point) {
12
+ point = projAlbers([latLng.lng, latLng.lat]);
13
+ }
14
+ return new Point(point[0], point[1]);
15
+ },
16
+ unproject(point) {
17
+ if (!isNaN(point.x) && !isNaN(point.y)) {
18
+ const latLng = projAlbers.invert([point.x, point.y]);
19
+ return new LatLng(latLng[1], latLng[0]);
20
+ } else {
21
+ return new LatLng(0, 0);
22
+ }
23
+ }
24
+ };
25
+
26
+ const AlbersCRS = Util.extend({}, CRS, {
27
+ projection: AlbersProjection,
28
+ transformation: new Transformation(1, 0, 1, 0),
29
+ infinite: true
30
+ });
31
+
32
+ export class AlbersLayer extends TileLayer {
33
+
34
+ _crs = AlbersCRS;
35
+
36
+ constructor() {
37
+ super();
38
+ }
39
+
40
+ hasBounds() {
41
+ return true;
42
+ }
43
+
44
+ getBounds() {
45
+ return new LatLngBounds([20, -123], [49, -64]);
46
+ }
47
+ }
48
+ AlbersLayer.prototype._class += " map_AlbersLayer";
@@ -1,9 +1,9 @@
1
- import { TileLayer } from "./TileLayer.ts";
2
-
3
- export class BlankLayer extends TileLayer {
4
-
5
- constructor() {
6
- super();
7
- }
8
- }
9
- BlankLayer.prototype._class += " map_BlankLayer";
1
+ import { TileLayer } from "./TileLayer.ts";
2
+
3
+ export class BlankLayer extends TileLayer {
4
+
5
+ constructor() {
6
+ super();
7
+ }
8
+ }
9
+ BlankLayer.prototype._class += " map_BlankLayer";
@@ -1,139 +1,139 @@
1
- import { Circle, Map } from "./leaflet-shim.ts";
2
- import { ClusterLayer, D3SurfaceLayer } from "./FeatureLayer.ts";
3
-
4
- export class Circles extends ClusterLayer {
5
-
6
- hasBounds(): boolean {
7
- return true;
8
- }
9
-
10
- layerUpdate(map: Map) {
11
- super.layerUpdate(map);
12
- const columns = this.columns();
13
- const latIdx = columns.indexOf(this.latitudeColumn());
14
- const longIdx = columns.indexOf(this.longitudeColumn());
15
- const strokeColorIdx = columns.indexOf(this.strokeColorColumn());
16
- const fillColorIdx = columns.indexOf(this.fillColorColumn());
17
- this.clear();
18
- this.data().filter(row => !this.omitNullLatLong() || (!!row[latIdx] && !!row[longIdx])).forEach(row => {
19
- this.add(new Circle([row[latIdx], row[longIdx]], {
20
- color: this.propValue(strokeColorIdx, row, this.strokeColor()),
21
- fill: true,
22
- fillColor: this.propValue(fillColorIdx, row, this.fillColor()),
23
- fillOpacity: this.fillOpacity(),
24
- radius: this.radius(),
25
- origRow: row
26
- } as any).on("click", e => this.clickHandler(e, row)));
27
- });
28
- }
29
-
30
- // Events ---
31
- clickHandler(e, row) {
32
- }
33
- }
34
- Circles.prototype._class += " map_Circles";
35
-
36
- export interface Circles {
37
- latitudeColumn(): string;
38
- latitudeColumn(_: string);
39
- longitudeColumn(): string;
40
- longitudeColumn(_: string);
41
- radius(): number;
42
- radius(_: number);
43
- strokeColor(): string;
44
- strokeColor(_: string);
45
- strokeColorColumn(): string;
46
- strokeColorColumn(_: string);
47
- strokColorColumn_exists(): boolean;
48
- fillColor(): string;
49
- fillColor(_: string);
50
- fillColorColumn(): string;
51
- fillColorColumn(_: string);
52
- fillColorColumn_exists(): boolean;
53
- fillOpacity(): number;
54
- fillOpacity(_: number);
55
- omitNullLatLong(): boolean;
56
- omitNullLatLong(_: boolean);
57
- }
58
-
59
- Circles.prototype.publish("latitudeColumn", null, "set", "Latitude column", function () { return this.columns(); }, { optional: true });
60
- Circles.prototype.publish("longitudeColumn", null, "set", "Longitude column", function () { return this.columns(); }, { optional: true });
61
- Circles.prototype.publish("radius", 50, "number", "Radius (meters)");
62
- Circles.prototype.publish("strokeColor", "#376cea", "html-color", "Stroke Color", null, { optional: true });
63
- Circles.prototype.publish("strokeColorColumn", null, "set", "Stroke color column", function () { return this.columns(); }, { optional: true });
64
- Circles.prototype.publish("fillColor", "#376cea", "html-color", "Fill Color", null, { optional: true });
65
- Circles.prototype.publish("fillColorColumn", null, "set", "Fill color column", function () { return this.columns(); }, { optional: true });
66
- Circles.prototype.publish("fillOpacity", 0.5, "number", "Opacity", null, { tags: ["Advanced"] });
67
- Circles.prototype.publish("omitNullLatLong", true, "boolean", "Remove lat=0,lng=0 from pinsData", null, { tags: ["Basic"] });
68
-
69
- // ---------------------------------------------------------------------------
70
- export class D3Circles extends D3SurfaceLayer {
71
-
72
- layerUpdate(map: Map, projection?) {
73
- super.layerUpdate(map, projection);
74
- const element = this._lfd3._rootGroup;
75
- projection = projection || this._lfd3.projection;
76
- const columns = this.columns();
77
- const latIdx = columns.indexOf(this.latitudeColumn());
78
- const longIdx = columns.indexOf(this.longitudeColumn());
79
- const strokeColorIdx = columns.indexOf(this.strokeColorColumn());
80
- const fillColorIdx = columns.indexOf(this.fillColorColumn());
81
- function toLatLng(d) {
82
- return {
83
- lat: +d[latIdx],
84
- lng: +d[longIdx]
85
- };
86
- }
87
- const updateSelection = element.selectAll("circle").data(this.data().filter(row => !this.omitNullLatLong() || (!!row[latIdx] && !!row[longIdx])));
88
- updateSelection.enter()
89
- .append("circle")
90
- .merge(updateSelection)
91
- .attr("cx", d => projection.latLngToLayerPoint(toLatLng(d)).x)
92
- .attr("cy", d => projection.latLngToLayerPoint(toLatLng(d)).y)
93
- .attr("r", Math.max(3 / projection.scale, this.radius() / projection.metresPerPixel)) // d => projection.metersToPixels(toLatLng(d), this.radius()))
94
- .style("fill-opacity", this.fillOpacity())
95
- .style("stroke", row => this.propValue(strokeColorIdx, row, this.strokeColor()))
96
- .attr("stroke-width", Math.max(1 / projection.scale, 1 / projection.metresPerPixel))
97
- .style("fill", row => this.propValue(fillColorIdx, row, this.fillColor()))
98
- ;
99
- updateSelection.exit().remove();
100
- }
101
-
102
- // Events ---
103
- clickHandler(e, row) {
104
- }
105
- }
106
- D3Circles.prototype._class += " map_D3Circles";
107
-
108
- export interface D3Circles {
109
- latitudeColumn(): string;
110
- latitudeColumn(_: string);
111
- longitudeColumn(): string;
112
- longitudeColumn(_: string);
113
- radius(): number;
114
- radius(_: number);
115
- strokeColor(): string;
116
- strokeColor(_: string);
117
- strokeColorColumn(): string;
118
- strokeColorColumn(_: string);
119
- strokColorColumn_exists(): boolean;
120
- fillColor(): string;
121
- fillColor(_: string);
122
- fillColorColumn(): string;
123
- fillColorColumn(_: string);
124
- fillColorColumn_exists(): boolean;
125
- fillOpacity(): number;
126
- fillOpacity(_: number);
127
- omitNullLatLong(): boolean;
128
- omitNullLatLong(_: boolean);
129
- }
130
-
131
- D3Circles.prototype.publish("latitudeColumn", null, "set", "Latitude column", function () { return this.columns(); }, { optional: true });
132
- D3Circles.prototype.publish("longitudeColumn", null, "set", "Longitude column", function () { return this.columns(); }, { optional: true });
133
- D3Circles.prototype.publish("radius", 50, "number", "Radius (meters)");
134
- D3Circles.prototype.publish("strokeColor", "#376cea", "html-color", "Stroke Color", null, { optional: true });
135
- D3Circles.prototype.publish("strokeColorColumn", null, "set", "Stroke color column", function () { return this.columns(); }, { optional: true });
136
- D3Circles.prototype.publish("fillColor", "#376cea", "html-color", "Fill Color", null, { optional: true });
137
- D3Circles.prototype.publish("fillColorColumn", null, "set", "Fill color column", function () { return this.columns(); }, { optional: true });
138
- D3Circles.prototype.publish("fillOpacity", 0.5, "number", "Opacity", null, { tags: ["Advanced"] });
139
- D3Circles.prototype.publish("omitNullLatLong", true, "boolean", "Remove lat=0,lng=0 from pinsData", null, { tags: ["Basic"] });
1
+ import { Circle, Map } from "./leaflet-shim.ts";
2
+ import { ClusterLayer, D3SurfaceLayer } from "./FeatureLayer.ts";
3
+
4
+ export class Circles extends ClusterLayer {
5
+
6
+ hasBounds(): boolean {
7
+ return true;
8
+ }
9
+
10
+ layerUpdate(map: Map) {
11
+ super.layerUpdate(map);
12
+ const columns = this.columns();
13
+ const latIdx = columns.indexOf(this.latitudeColumn());
14
+ const longIdx = columns.indexOf(this.longitudeColumn());
15
+ const strokeColorIdx = columns.indexOf(this.strokeColorColumn());
16
+ const fillColorIdx = columns.indexOf(this.fillColorColumn());
17
+ this.clear();
18
+ this.data().filter(row => !this.omitNullLatLong() || (!!row[latIdx] && !!row[longIdx])).forEach(row => {
19
+ this.add(new Circle([row[latIdx], row[longIdx]], {
20
+ color: this.propValue(strokeColorIdx, row, this.strokeColor()),
21
+ fill: true,
22
+ fillColor: this.propValue(fillColorIdx, row, this.fillColor()),
23
+ fillOpacity: this.fillOpacity(),
24
+ radius: this.radius(),
25
+ origRow: row
26
+ } as any).on("click", e => this.clickHandler(e, row)));
27
+ });
28
+ }
29
+
30
+ // Events ---
31
+ clickHandler(e, row) {
32
+ }
33
+ }
34
+ Circles.prototype._class += " map_Circles";
35
+
36
+ export interface Circles {
37
+ latitudeColumn(): string;
38
+ latitudeColumn(_: string);
39
+ longitudeColumn(): string;
40
+ longitudeColumn(_: string);
41
+ radius(): number;
42
+ radius(_: number);
43
+ strokeColor(): string;
44
+ strokeColor(_: string);
45
+ strokeColorColumn(): string;
46
+ strokeColorColumn(_: string);
47
+ strokColorColumn_exists(): boolean;
48
+ fillColor(): string;
49
+ fillColor(_: string);
50
+ fillColorColumn(): string;
51
+ fillColorColumn(_: string);
52
+ fillColorColumn_exists(): boolean;
53
+ fillOpacity(): number;
54
+ fillOpacity(_: number);
55
+ omitNullLatLong(): boolean;
56
+ omitNullLatLong(_: boolean);
57
+ }
58
+
59
+ Circles.prototype.publish("latitudeColumn", null, "set", "Latitude column", function () { return this.columns(); }, { optional: true });
60
+ Circles.prototype.publish("longitudeColumn", null, "set", "Longitude column", function () { return this.columns(); }, { optional: true });
61
+ Circles.prototype.publish("radius", 50, "number", "Radius (meters)");
62
+ Circles.prototype.publish("strokeColor", "#376cea", "html-color", "Stroke Color", null, { optional: true });
63
+ Circles.prototype.publish("strokeColorColumn", null, "set", "Stroke color column", function () { return this.columns(); }, { optional: true });
64
+ Circles.prototype.publish("fillColor", "#376cea", "html-color", "Fill Color", null, { optional: true });
65
+ Circles.prototype.publish("fillColorColumn", null, "set", "Fill color column", function () { return this.columns(); }, { optional: true });
66
+ Circles.prototype.publish("fillOpacity", 0.5, "number", "Opacity", null, { tags: ["Advanced"] });
67
+ Circles.prototype.publish("omitNullLatLong", true, "boolean", "Remove lat=0,lng=0 from pinsData", null, { tags: ["Basic"] });
68
+
69
+ // ---------------------------------------------------------------------------
70
+ export class D3Circles extends D3SurfaceLayer {
71
+
72
+ layerUpdate(map: Map, projection?) {
73
+ super.layerUpdate(map, projection);
74
+ const element = this._lfd3._rootGroup;
75
+ projection = projection || this._lfd3.projection;
76
+ const columns = this.columns();
77
+ const latIdx = columns.indexOf(this.latitudeColumn());
78
+ const longIdx = columns.indexOf(this.longitudeColumn());
79
+ const strokeColorIdx = columns.indexOf(this.strokeColorColumn());
80
+ const fillColorIdx = columns.indexOf(this.fillColorColumn());
81
+ function toLatLng(d) {
82
+ return {
83
+ lat: +d[latIdx],
84
+ lng: +d[longIdx]
85
+ };
86
+ }
87
+ const updateSelection = element.selectAll("circle").data(this.data().filter(row => !this.omitNullLatLong() || (!!row[latIdx] && !!row[longIdx])));
88
+ updateSelection.enter()
89
+ .append("circle")
90
+ .merge(updateSelection)
91
+ .attr("cx", d => projection.latLngToLayerPoint(toLatLng(d)).x)
92
+ .attr("cy", d => projection.latLngToLayerPoint(toLatLng(d)).y)
93
+ .attr("r", Math.max(3 / projection.scale, this.radius() / projection.metresPerPixel)) // d => projection.metersToPixels(toLatLng(d), this.radius()))
94
+ .style("fill-opacity", this.fillOpacity())
95
+ .style("stroke", row => this.propValue(strokeColorIdx, row, this.strokeColor()))
96
+ .attr("stroke-width", Math.max(1 / projection.scale, 1 / projection.metresPerPixel))
97
+ .style("fill", row => this.propValue(fillColorIdx, row, this.fillColor()))
98
+ ;
99
+ updateSelection.exit().remove();
100
+ }
101
+
102
+ // Events ---
103
+ clickHandler(e, row) {
104
+ }
105
+ }
106
+ D3Circles.prototype._class += " map_D3Circles";
107
+
108
+ export interface D3Circles {
109
+ latitudeColumn(): string;
110
+ latitudeColumn(_: string);
111
+ longitudeColumn(): string;
112
+ longitudeColumn(_: string);
113
+ radius(): number;
114
+ radius(_: number);
115
+ strokeColor(): string;
116
+ strokeColor(_: string);
117
+ strokeColorColumn(): string;
118
+ strokeColorColumn(_: string);
119
+ strokColorColumn_exists(): boolean;
120
+ fillColor(): string;
121
+ fillColor(_: string);
122
+ fillColorColumn(): string;
123
+ fillColorColumn(_: string);
124
+ fillColorColumn_exists(): boolean;
125
+ fillOpacity(): number;
126
+ fillOpacity(_: number);
127
+ omitNullLatLong(): boolean;
128
+ omitNullLatLong(_: boolean);
129
+ }
130
+
131
+ D3Circles.prototype.publish("latitudeColumn", null, "set", "Latitude column", function () { return this.columns(); }, { optional: true });
132
+ D3Circles.prototype.publish("longitudeColumn", null, "set", "Longitude column", function () { return this.columns(); }, { optional: true });
133
+ D3Circles.prototype.publish("radius", 50, "number", "Radius (meters)");
134
+ D3Circles.prototype.publish("strokeColor", "#376cea", "html-color", "Stroke Color", null, { optional: true });
135
+ D3Circles.prototype.publish("strokeColorColumn", null, "set", "Stroke color column", function () { return this.columns(); }, { optional: true });
136
+ D3Circles.prototype.publish("fillColor", "#376cea", "html-color", "Fill Color", null, { optional: true });
137
+ D3Circles.prototype.publish("fillColorColumn", null, "set", "Fill color column", function () { return this.columns(); }, { optional: true });
138
+ D3Circles.prototype.publish("fillOpacity", 0.5, "number", "Opacity", null, { tags: ["Advanced"] });
139
+ D3Circles.prototype.publish("omitNullLatLong", true, "boolean", "Remove lat=0,lng=0 from pinsData", null, { tags: ["Basic"] });
@@ -1,27 +1,27 @@
1
- .cluster-circle {
2
- background-clip: padding-box;
3
- font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
4
- }
5
-
6
- .cluster-circle > div {
7
- width: 40px;
8
- height: 40px;
9
-
10
- text-align: center;
11
- border-radius: 20px;
12
- }
13
-
14
- .cluster-circle > div > div {
15
- display: inline-block;
16
- margin-top: 5px;
17
- width: 30px;
18
- height: 30px;
19
-
20
- text-align: center;
21
- border-radius: 15px;
22
- font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
23
- }
24
-
25
- .cluster-circle span {
26
- line-height: 30px;
1
+ .cluster-circle {
2
+ background-clip: padding-box;
3
+ font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
4
+ }
5
+
6
+ .cluster-circle > div {
7
+ width: 40px;
8
+ height: 40px;
9
+
10
+ text-align: center;
11
+ border-radius: 20px;
12
+ }
13
+
14
+ .cluster-circle > div > div {
15
+ display: inline-block;
16
+ margin-top: 5px;
17
+ width: 30px;
18
+ height: 30px;
19
+
20
+ text-align: center;
21
+ border-radius: 15px;
22
+ font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
23
+ }
24
+
25
+ .cluster-circle span {
26
+ line-height: 30px;
27
27
  }