@hpcc-js/map 3.5.2 → 3.5.4
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.
- package/LICENSE +43 -43
- package/README.md +88 -88
- package/TopoJSON/BR.json +122 -122
- package/TopoJSON/GB_idx.json +1 -1
- package/TopoJSON/IE_idx.json +1 -1
- package/TopoJSON/ND_idx.json +1 -1
- package/TopoJSON/countries.json +257 -257
- package/TopoJSON/us-counties.json +16550 -16550
- package/TopoJSON/us-states.json +458 -458
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +9 -9
- package/src/CanvasPinLayer.ts +99 -99
- package/src/CanvasPins.ts +397 -397
- package/src/Choropleth.css +26 -26
- package/src/Choropleth.ts +203 -203
- package/src/ChoroplethContinents.ts +13 -13
- package/src/ChoroplethCounties.ts +111 -111
- package/src/ChoroplethCountries.ts +100 -100
- package/src/ChoroplethStates.ts +103 -103
- package/src/ChoroplethStatesHeat.ts +8 -8
- package/src/GMap.css +20 -20
- package/src/GMap.ts +880 -880
- package/src/GMapCounties.ts +93 -93
- package/src/GMapGraph.ts +61 -61
- package/src/GMapHeat.ts +27 -27
- package/src/GMapLayered.ts +94 -94
- package/src/GMapPin.ts +115 -115
- package/src/GMapPinLine.ts +138 -138
- package/src/GeoHash.css +14 -14
- package/src/GeoHash.ts +139 -139
- package/src/Graph.css +9 -9
- package/src/Graph.ts +98 -98
- package/src/Graticule.css +12 -12
- package/src/Graticule.ts +97 -97
- package/src/Heat.ts +87 -87
- package/src/IChoropleth.ts +8 -8
- package/src/Layer.ts +99 -99
- package/src/Layered.css +18 -18
- package/src/Layered.ts +206 -206
- package/src/Lines.css +8 -8
- package/src/Lines.ts +78 -78
- package/src/OpenStreet.css +15 -15
- package/src/OpenStreet.ts +126 -126
- package/src/Pins.css +17 -17
- package/src/Pins.ts +350 -350
- package/src/Projection.ts +42 -42
- package/src/TestHeatMap.ts +8 -8
- package/src/TopoJSONChoropleth.ts +125 -125
- package/src/Utility.ts +484 -484
- package/src/__package__.ts +3 -3
- package/src/index.ts +33 -33
- package/src/leaflet/AlbersPR.ts +48 -48
- package/src/leaflet/Blank.ts +9 -9
- package/src/leaflet/Circles.ts +139 -139
- package/src/leaflet/ClusterCircles.css +26 -26
- package/src/leaflet/ClusterCircles.ts +88 -88
- package/src/leaflet/Countries.ts +43 -43
- package/src/leaflet/DrawLayer.ts +167 -167
- package/src/leaflet/FeatureLayer.ts +138 -138
- package/src/leaflet/GMap.ts +44 -44
- package/src/leaflet/HeatLayer.ts +77 -77
- package/src/leaflet/Icons.ts +60 -60
- package/src/leaflet/Leaflet.css +3 -3
- package/src/leaflet/Leaflet.ts +239 -239
- package/src/leaflet/MapBox.ts +35 -35
- package/src/leaflet/Markers.ts +109 -109
- package/src/leaflet/OpenStreet.ts +27 -27
- package/src/leaflet/Path.ts +138 -138
- package/src/leaflet/Pins.ts +73 -73
- package/src/leaflet/Polygons.ts +113 -113
- package/src/leaflet/Region.ts +138 -138
- package/src/leaflet/Text.ts +99 -99
- package/src/leaflet/TileLayer.ts +81 -81
- package/src/leaflet/TopoJSON.ts +146 -146
- package/src/leaflet/US.ts +15 -15
- package/src/leaflet/USCounties.ts +43 -43
- package/src/leaflet/USStates.ts +41 -41
- package/src/leaflet/World.css +3 -3
- package/src/leaflet/World.ts +172 -172
- package/src/leaflet/index.ts +18 -18
- package/src/leaflet/leaflet-shim.ts +18 -18
- package/src/leaflet/plugins/BeautifyIcon.css +44 -44
- package/src/leaflet/plugins/BeautifyIcon.ts +190 -190
- package/src/leaflet/plugins/BeutifyIcon.licence +20 -20
- package/src/leaflet/plugins/D3SvgOverlay.css +2 -2
- package/src/leaflet/plugins/D3SvgOverlay.licence +20 -20
- package/src/leaflet/plugins/D3SvgOverlay.ts +175 -175
- package/src/leaflet/plugins/HeatLayer.license +21 -21
- package/src/leaflet/plugins/HeatLayer.ts +224 -224
- package/src/leaflet/plugins/Leaflet.GoogleMutant.ts +424 -424
- package/src/leaflet/plugins/lru_map.ts +352 -352
- package/src/test.ts +114 -114
- package/types/Layered.d.ts +1 -1
package/src/GMapPin.ts
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import { GMapLayered } from "./GMapLayered.ts";
|
|
2
|
-
import { Pins } from "./Pins.ts";
|
|
3
|
-
|
|
4
|
-
export class GMapPin extends GMapLayered {
|
|
5
|
-
_pins;
|
|
6
|
-
_view;
|
|
7
|
-
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
|
|
11
|
-
const context = this;
|
|
12
|
-
this._pins = new Pins()
|
|
13
|
-
.columns(["lat", "long", "ext"])
|
|
14
|
-
.on("click", function (row, col, sel) {
|
|
15
|
-
context.click(context.rowToObj(row.ext.origRow), "", sel);
|
|
16
|
-
context.clickStreetView(context.rowToObj(row.ext.origRow), "", sel);
|
|
17
|
-
})
|
|
18
|
-
.on("dblclick", function (row, col, sel) {
|
|
19
|
-
context.dblclick(context.rowToObj(row.ext.origRow), "", sel);
|
|
20
|
-
})
|
|
21
|
-
;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
pinsData() {
|
|
25
|
-
if (this.data().length === 0) return [];
|
|
26
|
-
const columns = this.columns();
|
|
27
|
-
this._view = this._db.rollupView([this.latitudeColumn(), this.longitudeColumn()]);
|
|
28
|
-
return this._view.entries().map(function (row) {
|
|
29
|
-
const firstRow = row.values[0].value[0];
|
|
30
|
-
return [row.key, row.values[0].key, {
|
|
31
|
-
fillColor: firstRow[columns.indexOf(this.colorColumn())],
|
|
32
|
-
tooltip: firstRow[columns.indexOf(this.tooltipColumn())],
|
|
33
|
-
origRow: firstRow
|
|
34
|
-
}];
|
|
35
|
-
}, this);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
enter(domNode, element) {
|
|
39
|
-
super.enter(domNode, element);
|
|
40
|
-
this
|
|
41
|
-
.layers([
|
|
42
|
-
this._pins
|
|
43
|
-
])
|
|
44
|
-
;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
private _prevChecksum;
|
|
48
|
-
update(domNode, element) {
|
|
49
|
-
super.update(domNode, element);
|
|
50
|
-
this._pins.data(this.pinsData());
|
|
51
|
-
if (this.autoScale() && this._prevChecksum !== this._db.checksum()) {
|
|
52
|
-
this._prevChecksum = this._db.checksum();
|
|
53
|
-
this.zoomTo(this._pins.pinsData().map(function (row) { return [row.lat, row.long]; }));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
exit(domNode, element) {
|
|
58
|
-
super.exit(domNode, element);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
click(row, column, selected) {
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
clickStreetView(row, column, selected) {
|
|
65
|
-
if (this.streetViewOnClick()) {
|
|
66
|
-
this.streetViewAt({
|
|
67
|
-
lat: +row[this.latitudeColumn()],
|
|
68
|
-
lng: +row[this.longitudeColumn()]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
dblclick(row, column, selected) {
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
GMapPin.prototype._class += " map_GMapPin";
|
|
77
|
-
|
|
78
|
-
export interface GMapPin {
|
|
79
|
-
autoScale(): boolean;
|
|
80
|
-
autoScale(_: boolean): this;
|
|
81
|
-
latitudeColumn(): string;
|
|
82
|
-
latitudeColumn(_: string): this;
|
|
83
|
-
latitudeColumn_exists(): boolean;
|
|
84
|
-
longitudeColumn(): string;
|
|
85
|
-
longitudeColumn(_: string): this;
|
|
86
|
-
longitudeColumn_exists(): boolean;
|
|
87
|
-
colorColumn(): string;
|
|
88
|
-
colorColumn(_: string): this;
|
|
89
|
-
colorColumn_exists(): boolean;
|
|
90
|
-
tooltipColumn(): string;
|
|
91
|
-
tooltipColumn(_: string): this;
|
|
92
|
-
tooltipColumn_exists(): boolean;
|
|
93
|
-
streetViewOnClick(): boolean;
|
|
94
|
-
streetViewOnClick(_: boolean): this;
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
GMapPin.prototype.publish("autoScale", false, "boolean", "Auto scale to data");
|
|
99
|
-
GMapPin.prototype.publishProxy("pinColor", "_pins", "fillColor");
|
|
100
|
-
GMapPin.prototype.publishProxy("pinType", "_pins", "pinType");
|
|
101
|
-
GMapPin.prototype.publishProxy("pinWidth", "_pins", "pinWidth");
|
|
102
|
-
GMapPin.prototype.publishProxy("pinHeight", "_pins", "pinHeight");
|
|
103
|
-
GMapPin.prototype.publishProxy("cornerRadius", "_pins", "cornerRadius");
|
|
104
|
-
GMapPin.prototype.publishProxy("pinRadius", "_pins", "pinRadius");
|
|
105
|
-
GMapPin.prototype.publishProxy("arrowWidth", "_pins", "arrowWidth");
|
|
106
|
-
GMapPin.prototype.publishProxy("arrowHeight", "_pins", "arrowHeight");
|
|
107
|
-
GMapPin.prototype.publishProxy("textBaseline", "_pins", "textBaseline");
|
|
108
|
-
GMapPin.prototype.publishProxy("strokeWidth", "_pins", "strokeWidth");
|
|
109
|
-
GMapPin.prototype.publishProxy("omitNullLatLong", "_pins", "omitNullLatLong");
|
|
110
|
-
|
|
111
|
-
GMapPin.prototype.publish("latitudeColumn", null, "set", "Latitude", function () { return this.columns(); }, { optional: true });
|
|
112
|
-
GMapPin.prototype.publish("longitudeColumn", null, "set", "Longitude", function () { return this.columns(); }, { optional: true });
|
|
113
|
-
GMapPin.prototype.publish("colorColumn", null, "set", "Color", function () { return this.columns(); }, { optional: true });
|
|
114
|
-
GMapPin.prototype.publish("tooltipColumn", null, "set", "Tooltip", function () { return this.columns(); }, { optional: true });
|
|
115
|
-
GMapPin.prototype.publish("streetViewOnClick", false, "boolean", "Switch to street view when pin clicked");
|
|
1
|
+
import { GMapLayered } from "./GMapLayered.ts";
|
|
2
|
+
import { Pins } from "./Pins.ts";
|
|
3
|
+
|
|
4
|
+
export class GMapPin extends GMapLayered {
|
|
5
|
+
_pins;
|
|
6
|
+
_view;
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
|
|
11
|
+
const context = this;
|
|
12
|
+
this._pins = new Pins()
|
|
13
|
+
.columns(["lat", "long", "ext"])
|
|
14
|
+
.on("click", function (row, col, sel) {
|
|
15
|
+
context.click(context.rowToObj(row.ext.origRow), "", sel);
|
|
16
|
+
context.clickStreetView(context.rowToObj(row.ext.origRow), "", sel);
|
|
17
|
+
})
|
|
18
|
+
.on("dblclick", function (row, col, sel) {
|
|
19
|
+
context.dblclick(context.rowToObj(row.ext.origRow), "", sel);
|
|
20
|
+
})
|
|
21
|
+
;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
pinsData() {
|
|
25
|
+
if (this.data().length === 0) return [];
|
|
26
|
+
const columns = this.columns();
|
|
27
|
+
this._view = this._db.rollupView([this.latitudeColumn(), this.longitudeColumn()]);
|
|
28
|
+
return this._view.entries().map(function (row) {
|
|
29
|
+
const firstRow = row.values[0].value[0];
|
|
30
|
+
return [row.key, row.values[0].key, {
|
|
31
|
+
fillColor: firstRow[columns.indexOf(this.colorColumn())],
|
|
32
|
+
tooltip: firstRow[columns.indexOf(this.tooltipColumn())],
|
|
33
|
+
origRow: firstRow
|
|
34
|
+
}];
|
|
35
|
+
}, this);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
enter(domNode, element) {
|
|
39
|
+
super.enter(domNode, element);
|
|
40
|
+
this
|
|
41
|
+
.layers([
|
|
42
|
+
this._pins
|
|
43
|
+
])
|
|
44
|
+
;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private _prevChecksum;
|
|
48
|
+
update(domNode, element) {
|
|
49
|
+
super.update(domNode, element);
|
|
50
|
+
this._pins.data(this.pinsData());
|
|
51
|
+
if (this.autoScale() && this._prevChecksum !== this._db.checksum()) {
|
|
52
|
+
this._prevChecksum = this._db.checksum();
|
|
53
|
+
this.zoomTo(this._pins.pinsData().map(function (row) { return [row.lat, row.long]; }));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exit(domNode, element) {
|
|
58
|
+
super.exit(domNode, element);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
click(row, column, selected) {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
clickStreetView(row, column, selected) {
|
|
65
|
+
if (this.streetViewOnClick()) {
|
|
66
|
+
this.streetViewAt({
|
|
67
|
+
lat: +row[this.latitudeColumn()],
|
|
68
|
+
lng: +row[this.longitudeColumn()]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
dblclick(row, column, selected) {
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
GMapPin.prototype._class += " map_GMapPin";
|
|
77
|
+
|
|
78
|
+
export interface GMapPin {
|
|
79
|
+
autoScale(): boolean;
|
|
80
|
+
autoScale(_: boolean): this;
|
|
81
|
+
latitudeColumn(): string;
|
|
82
|
+
latitudeColumn(_: string): this;
|
|
83
|
+
latitudeColumn_exists(): boolean;
|
|
84
|
+
longitudeColumn(): string;
|
|
85
|
+
longitudeColumn(_: string): this;
|
|
86
|
+
longitudeColumn_exists(): boolean;
|
|
87
|
+
colorColumn(): string;
|
|
88
|
+
colorColumn(_: string): this;
|
|
89
|
+
colorColumn_exists(): boolean;
|
|
90
|
+
tooltipColumn(): string;
|
|
91
|
+
tooltipColumn(_: string): this;
|
|
92
|
+
tooltipColumn_exists(): boolean;
|
|
93
|
+
streetViewOnClick(): boolean;
|
|
94
|
+
streetViewOnClick(_: boolean): this;
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
GMapPin.prototype.publish("autoScale", false, "boolean", "Auto scale to data");
|
|
99
|
+
GMapPin.prototype.publishProxy("pinColor", "_pins", "fillColor");
|
|
100
|
+
GMapPin.prototype.publishProxy("pinType", "_pins", "pinType");
|
|
101
|
+
GMapPin.prototype.publishProxy("pinWidth", "_pins", "pinWidth");
|
|
102
|
+
GMapPin.prototype.publishProxy("pinHeight", "_pins", "pinHeight");
|
|
103
|
+
GMapPin.prototype.publishProxy("cornerRadius", "_pins", "cornerRadius");
|
|
104
|
+
GMapPin.prototype.publishProxy("pinRadius", "_pins", "pinRadius");
|
|
105
|
+
GMapPin.prototype.publishProxy("arrowWidth", "_pins", "arrowWidth");
|
|
106
|
+
GMapPin.prototype.publishProxy("arrowHeight", "_pins", "arrowHeight");
|
|
107
|
+
GMapPin.prototype.publishProxy("textBaseline", "_pins", "textBaseline");
|
|
108
|
+
GMapPin.prototype.publishProxy("strokeWidth", "_pins", "strokeWidth");
|
|
109
|
+
GMapPin.prototype.publishProxy("omitNullLatLong", "_pins", "omitNullLatLong");
|
|
110
|
+
|
|
111
|
+
GMapPin.prototype.publish("latitudeColumn", null, "set", "Latitude", function () { return this.columns(); }, { optional: true });
|
|
112
|
+
GMapPin.prototype.publish("longitudeColumn", null, "set", "Longitude", function () { return this.columns(); }, { optional: true });
|
|
113
|
+
GMapPin.prototype.publish("colorColumn", null, "set", "Color", function () { return this.columns(); }, { optional: true });
|
|
114
|
+
GMapPin.prototype.publish("tooltipColumn", null, "set", "Tooltip", function () { return this.columns(); }, { optional: true });
|
|
115
|
+
GMapPin.prototype.publish("streetViewOnClick", false, "boolean", "Switch to street view when pin clicked");
|
package/src/GMapPinLine.ts
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
import { GMapLayered } from "./GMapLayered.ts";
|
|
2
|
-
import { Lines } from "./Lines.ts";
|
|
3
|
-
import { Pins } from "./Pins.ts";
|
|
4
|
-
|
|
5
|
-
export class GMapPinLine extends GMapLayered {
|
|
6
|
-
_lines;
|
|
7
|
-
_pins;
|
|
8
|
-
_fromView;
|
|
9
|
-
_toView;
|
|
10
|
-
_linesView;
|
|
11
|
-
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
|
|
15
|
-
const context = this;
|
|
16
|
-
this._lines = new Lines();
|
|
17
|
-
this._pins = new Pins()
|
|
18
|
-
.columns(["lat", "long", "ext"])
|
|
19
|
-
.on("click", function (row, col, sel) {
|
|
20
|
-
context.click(context.rowToObj(row.ext.origRow), "", sel);
|
|
21
|
-
})
|
|
22
|
-
.on("dblclick", function (row, col, sel) {
|
|
23
|
-
context.click(context.rowToObj(row.ext.origRow), "", sel);
|
|
24
|
-
})
|
|
25
|
-
;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
pinsData() {
|
|
29
|
-
if (this.data().length === 0) return [];
|
|
30
|
-
const columns = this.columns();
|
|
31
|
-
this._fromView = this._db.rollupView([this.fromLatitudeColumn(), this.fromLongitudeColumn()]);
|
|
32
|
-
this._toView = this._db.rollupView([this.toLatitudeColumn(), this.toLongitudeColumn()]);
|
|
33
|
-
const fromRetVal = this._fromView.entries().map(function (row) {
|
|
34
|
-
const firstRow = row.values[0].value[0];
|
|
35
|
-
return [row.key, row.values[0].key, {
|
|
36
|
-
fillColor: firstRow[columns.indexOf(this.fromColorColumn())] || this.fromPinColor(),
|
|
37
|
-
tooltip: firstRow[columns.indexOf(this.fromTooltipColumn())],
|
|
38
|
-
origRow: firstRow
|
|
39
|
-
}];
|
|
40
|
-
}, this);
|
|
41
|
-
const toRetVal = this._toView.entries().map(function (row) {
|
|
42
|
-
const firstRow = row.values[0].value[0];
|
|
43
|
-
return [row.key, row.values[0].key, {
|
|
44
|
-
fillColor: firstRow[columns.indexOf(this.toColorColumn())] || this.toPinColor(),
|
|
45
|
-
tooltip: firstRow[columns.indexOf(this.toTooltipColumn())],
|
|
46
|
-
origRow: firstRow
|
|
47
|
-
}];
|
|
48
|
-
}, this);
|
|
49
|
-
return fromRetVal.concat(toRetVal);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
linesData() {
|
|
53
|
-
if (this.data().length === 0) return [];
|
|
54
|
-
this._linesView = this._db.rollupView([this.fromLatitudeColumn(), this.fromLongitudeColumn(), this.toLatitudeColumn(), this.toLongitudeColumn()]);
|
|
55
|
-
return this._linesView.data();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
enter(domNode, element) {
|
|
59
|
-
super.enter(domNode, element);
|
|
60
|
-
this
|
|
61
|
-
.layers([
|
|
62
|
-
this._lines,
|
|
63
|
-
this._pins
|
|
64
|
-
])
|
|
65
|
-
;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
private _prevChecksum;
|
|
69
|
-
update(domNode, element) {
|
|
70
|
-
super.update(domNode, element);
|
|
71
|
-
this._pins.data(this.pinsData());
|
|
72
|
-
this._lines.data(this.linesData());
|
|
73
|
-
if (this.autoScale() && this._prevChecksum !== this._db.checksum()) {
|
|
74
|
-
this._prevChecksum = this._db.checksum();
|
|
75
|
-
this.zoomTo(this._pins.pinsData().map(function (row) { return [row.lat, row.long]; }));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
exit(domNode, element) {
|
|
80
|
-
super.exit(domNode, element);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
click(row, column, selected) {
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
dblclick(row, column, selected) {
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
GMapPinLine.prototype._class += " map_GMapPinLine";
|
|
90
|
-
|
|
91
|
-
export interface GMapPinLine {
|
|
92
|
-
autoScale(): boolean;
|
|
93
|
-
autoScale(_: boolean): GMapPinLine;
|
|
94
|
-
fromPinColor(): string;
|
|
95
|
-
fromPinColor(_: string): GMapPinLine;
|
|
96
|
-
fromPinColor_exists(): boolean;
|
|
97
|
-
fromLatitudeColumn(): string;
|
|
98
|
-
fromLatitudeColumn(_: string): GMapPinLine;
|
|
99
|
-
fromLatitudeColumn_exists(): boolean;
|
|
100
|
-
fromLongitudeColumn(): string;
|
|
101
|
-
fromLongitudeColumn(_: string): GMapPinLine;
|
|
102
|
-
fromLongitudeColumn_exists(): boolean;
|
|
103
|
-
fromColorColumn(): string;
|
|
104
|
-
fromColorColumn(_: string): GMapPinLine;
|
|
105
|
-
fromColorColumn_exists(): boolean;
|
|
106
|
-
fromTooltipColumn(): string;
|
|
107
|
-
fromTooltipColumn(_: string): GMapPinLine;
|
|
108
|
-
fromTooltipColumn_exists(): boolean;
|
|
109
|
-
|
|
110
|
-
toPinColor(): string;
|
|
111
|
-
toPinColor(_: string): GMapPinLine;
|
|
112
|
-
toPinColor_exists(): boolean;
|
|
113
|
-
toLatitudeColumn(): string;
|
|
114
|
-
toLatitudeColumn(_: string): GMapPinLine;
|
|
115
|
-
toLatitudeColumn_exists(): boolean;
|
|
116
|
-
toLongitudeColumn(): string;
|
|
117
|
-
toLongitudeColumn(_: string): GMapPinLine;
|
|
118
|
-
toLongitudeColumn_exists(): boolean;
|
|
119
|
-
toColorColumn(): string;
|
|
120
|
-
toColorColumn(_: string): GMapPinLine;
|
|
121
|
-
toColorColumn_exists(): boolean;
|
|
122
|
-
toTooltipColumn(): string;
|
|
123
|
-
toTooltipColumn(_: string): GMapPinLine;
|
|
124
|
-
toTooltipColumn_exists(): boolean;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
GMapPinLine.prototype.publish("autoScale", false, "boolean", "Auto scale to data");
|
|
128
|
-
GMapPinLine.prototype.publish("fromPinColor", "green", "html-color", "From Pin Color");
|
|
129
|
-
GMapPinLine.prototype.publish("fromLatitudeColumn", null, "set", "From Latitude", function () { return this.columns(); }, { optional: true });
|
|
130
|
-
GMapPinLine.prototype.publish("fromLongitudeColumn", null, "set", "From Longitude", function () { return this.columns(); }, { optional: true });
|
|
131
|
-
GMapPinLine.prototype.publish("fromColorColumn", null, "set", "From Color", function () { return this.columns(); }, { optional: true });
|
|
132
|
-
GMapPinLine.prototype.publish("fromTooltipColumn", null, "set", "From Tooltip", function () { return this.columns(); }, { optional: true });
|
|
133
|
-
|
|
134
|
-
GMapPinLine.prototype.publish("toPinColor", "red", "html-color", "To Pin Color");
|
|
135
|
-
GMapPinLine.prototype.publish("toLatitudeColumn", null, "set", "To Latitude", function () { return this.columns(); }, { optional: true });
|
|
136
|
-
GMapPinLine.prototype.publish("toLongitudeColumn", null, "set", "To Longitude", function () { return this.columns(); }, { optional: true });
|
|
137
|
-
GMapPinLine.prototype.publish("toColorColumn", null, "set", "To Color", function () { return this.columns(); }, { optional: true });
|
|
138
|
-
GMapPinLine.prototype.publish("toTooltipColumn", null, "set", "To Tooltip", function () { return this.columns(); }, { optional: true });
|
|
1
|
+
import { GMapLayered } from "./GMapLayered.ts";
|
|
2
|
+
import { Lines } from "./Lines.ts";
|
|
3
|
+
import { Pins } from "./Pins.ts";
|
|
4
|
+
|
|
5
|
+
export class GMapPinLine extends GMapLayered {
|
|
6
|
+
_lines;
|
|
7
|
+
_pins;
|
|
8
|
+
_fromView;
|
|
9
|
+
_toView;
|
|
10
|
+
_linesView;
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
|
|
15
|
+
const context = this;
|
|
16
|
+
this._lines = new Lines();
|
|
17
|
+
this._pins = new Pins()
|
|
18
|
+
.columns(["lat", "long", "ext"])
|
|
19
|
+
.on("click", function (row, col, sel) {
|
|
20
|
+
context.click(context.rowToObj(row.ext.origRow), "", sel);
|
|
21
|
+
})
|
|
22
|
+
.on("dblclick", function (row, col, sel) {
|
|
23
|
+
context.click(context.rowToObj(row.ext.origRow), "", sel);
|
|
24
|
+
})
|
|
25
|
+
;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
pinsData() {
|
|
29
|
+
if (this.data().length === 0) return [];
|
|
30
|
+
const columns = this.columns();
|
|
31
|
+
this._fromView = this._db.rollupView([this.fromLatitudeColumn(), this.fromLongitudeColumn()]);
|
|
32
|
+
this._toView = this._db.rollupView([this.toLatitudeColumn(), this.toLongitudeColumn()]);
|
|
33
|
+
const fromRetVal = this._fromView.entries().map(function (row) {
|
|
34
|
+
const firstRow = row.values[0].value[0];
|
|
35
|
+
return [row.key, row.values[0].key, {
|
|
36
|
+
fillColor: firstRow[columns.indexOf(this.fromColorColumn())] || this.fromPinColor(),
|
|
37
|
+
tooltip: firstRow[columns.indexOf(this.fromTooltipColumn())],
|
|
38
|
+
origRow: firstRow
|
|
39
|
+
}];
|
|
40
|
+
}, this);
|
|
41
|
+
const toRetVal = this._toView.entries().map(function (row) {
|
|
42
|
+
const firstRow = row.values[0].value[0];
|
|
43
|
+
return [row.key, row.values[0].key, {
|
|
44
|
+
fillColor: firstRow[columns.indexOf(this.toColorColumn())] || this.toPinColor(),
|
|
45
|
+
tooltip: firstRow[columns.indexOf(this.toTooltipColumn())],
|
|
46
|
+
origRow: firstRow
|
|
47
|
+
}];
|
|
48
|
+
}, this);
|
|
49
|
+
return fromRetVal.concat(toRetVal);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
linesData() {
|
|
53
|
+
if (this.data().length === 0) return [];
|
|
54
|
+
this._linesView = this._db.rollupView([this.fromLatitudeColumn(), this.fromLongitudeColumn(), this.toLatitudeColumn(), this.toLongitudeColumn()]);
|
|
55
|
+
return this._linesView.data();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
enter(domNode, element) {
|
|
59
|
+
super.enter(domNode, element);
|
|
60
|
+
this
|
|
61
|
+
.layers([
|
|
62
|
+
this._lines,
|
|
63
|
+
this._pins
|
|
64
|
+
])
|
|
65
|
+
;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private _prevChecksum;
|
|
69
|
+
update(domNode, element) {
|
|
70
|
+
super.update(domNode, element);
|
|
71
|
+
this._pins.data(this.pinsData());
|
|
72
|
+
this._lines.data(this.linesData());
|
|
73
|
+
if (this.autoScale() && this._prevChecksum !== this._db.checksum()) {
|
|
74
|
+
this._prevChecksum = this._db.checksum();
|
|
75
|
+
this.zoomTo(this._pins.pinsData().map(function (row) { return [row.lat, row.long]; }));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
exit(domNode, element) {
|
|
80
|
+
super.exit(domNode, element);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
click(row, column, selected) {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
dblclick(row, column, selected) {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
GMapPinLine.prototype._class += " map_GMapPinLine";
|
|
90
|
+
|
|
91
|
+
export interface GMapPinLine {
|
|
92
|
+
autoScale(): boolean;
|
|
93
|
+
autoScale(_: boolean): GMapPinLine;
|
|
94
|
+
fromPinColor(): string;
|
|
95
|
+
fromPinColor(_: string): GMapPinLine;
|
|
96
|
+
fromPinColor_exists(): boolean;
|
|
97
|
+
fromLatitudeColumn(): string;
|
|
98
|
+
fromLatitudeColumn(_: string): GMapPinLine;
|
|
99
|
+
fromLatitudeColumn_exists(): boolean;
|
|
100
|
+
fromLongitudeColumn(): string;
|
|
101
|
+
fromLongitudeColumn(_: string): GMapPinLine;
|
|
102
|
+
fromLongitudeColumn_exists(): boolean;
|
|
103
|
+
fromColorColumn(): string;
|
|
104
|
+
fromColorColumn(_: string): GMapPinLine;
|
|
105
|
+
fromColorColumn_exists(): boolean;
|
|
106
|
+
fromTooltipColumn(): string;
|
|
107
|
+
fromTooltipColumn(_: string): GMapPinLine;
|
|
108
|
+
fromTooltipColumn_exists(): boolean;
|
|
109
|
+
|
|
110
|
+
toPinColor(): string;
|
|
111
|
+
toPinColor(_: string): GMapPinLine;
|
|
112
|
+
toPinColor_exists(): boolean;
|
|
113
|
+
toLatitudeColumn(): string;
|
|
114
|
+
toLatitudeColumn(_: string): GMapPinLine;
|
|
115
|
+
toLatitudeColumn_exists(): boolean;
|
|
116
|
+
toLongitudeColumn(): string;
|
|
117
|
+
toLongitudeColumn(_: string): GMapPinLine;
|
|
118
|
+
toLongitudeColumn_exists(): boolean;
|
|
119
|
+
toColorColumn(): string;
|
|
120
|
+
toColorColumn(_: string): GMapPinLine;
|
|
121
|
+
toColorColumn_exists(): boolean;
|
|
122
|
+
toTooltipColumn(): string;
|
|
123
|
+
toTooltipColumn(_: string): GMapPinLine;
|
|
124
|
+
toTooltipColumn_exists(): boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
GMapPinLine.prototype.publish("autoScale", false, "boolean", "Auto scale to data");
|
|
128
|
+
GMapPinLine.prototype.publish("fromPinColor", "green", "html-color", "From Pin Color");
|
|
129
|
+
GMapPinLine.prototype.publish("fromLatitudeColumn", null, "set", "From Latitude", function () { return this.columns(); }, { optional: true });
|
|
130
|
+
GMapPinLine.prototype.publish("fromLongitudeColumn", null, "set", "From Longitude", function () { return this.columns(); }, { optional: true });
|
|
131
|
+
GMapPinLine.prototype.publish("fromColorColumn", null, "set", "From Color", function () { return this.columns(); }, { optional: true });
|
|
132
|
+
GMapPinLine.prototype.publish("fromTooltipColumn", null, "set", "From Tooltip", function () { return this.columns(); }, { optional: true });
|
|
133
|
+
|
|
134
|
+
GMapPinLine.prototype.publish("toPinColor", "red", "html-color", "To Pin Color");
|
|
135
|
+
GMapPinLine.prototype.publish("toLatitudeColumn", null, "set", "To Latitude", function () { return this.columns(); }, { optional: true });
|
|
136
|
+
GMapPinLine.prototype.publish("toLongitudeColumn", null, "set", "To Longitude", function () { return this.columns(); }, { optional: true });
|
|
137
|
+
GMapPinLine.prototype.publish("toColorColumn", null, "set", "To Color", function () { return this.columns(); }, { optional: true });
|
|
138
|
+
GMapPinLine.prototype.publish("toTooltipColumn", null, "set", "To Tooltip", function () { return this.columns(); }, { optional: true });
|
package/src/GeoHash.css
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
.map_Layered .map_GeoHash .data {
|
|
2
|
-
stroke: none;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.map_Layered .map_GeoHash .data.selected {
|
|
6
|
-
stroke: red;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.map_Layered .map_GeoHash .data.over {
|
|
10
|
-
stroke: orange;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.map_Layered .map_GeoHash .data.selected.over {
|
|
14
|
-
stroke: red;
|
|
1
|
+
.map_Layered .map_GeoHash .data {
|
|
2
|
+
stroke: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.map_Layered .map_GeoHash .data.selected {
|
|
6
|
+
stroke: red;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.map_Layered .map_GeoHash .data.over {
|
|
10
|
+
stroke: orange;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.map_Layered .map_GeoHash .data.selected.over {
|
|
14
|
+
stroke: red;
|
|
15
15
|
}
|