@hpcc-js/map 2.79.2 → 2.79.3
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.es6.js +19969 -19969
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +19967 -19967
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/package.json +9 -9
- package/src/CanvasPinLayer.ts +99 -99
- package/src/CanvasPins.ts +396 -396
- package/src/Choropleth.css +27 -27
- package/src/Choropleth.ts +195 -195
- package/src/ChoroplethContinents.ts +13 -13
- package/src/ChoroplethCounties.ts +109 -109
- package/src/ChoroplethCountries.ts +100 -100
- package/src/ChoroplethStates.ts +104 -104
- package/src/ChoroplethStatesHeat.ts +8 -8
- package/src/GMap.css +16 -16
- package/src/GMap.ts +879 -879
- 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 +125 -125
- package/src/GeoHash.css +15 -15
- package/src/GeoHash.ts +125 -125
- package/src/Graph.css +10 -10
- package/src/Graph.ts +98 -98
- package/src/Graticule.css +13 -13
- package/src/Graticule.ts +90 -90
- package/src/Heat.css +2 -2
- package/src/Heat.ts +82 -82
- package/src/IChoropleth.ts +8 -8
- package/src/Layer.ts +90 -90
- package/src/Layered.css +19 -19
- package/src/Layered.ts +206 -206
- package/src/Lines.css +9 -9
- package/src/Lines.ts +75 -75
- package/src/OpenStreet.css +15 -15
- package/src/OpenStreet.ts +123 -123
- package/src/Pins.css +18 -18
- package/src/Pins.ts +319 -319
- package/src/Projection.ts +42 -42
- package/src/TestHeatMap.ts +8 -8
- package/src/TopoJSONChoropleth.ts +114 -114
- package/src/Utility.ts +482 -482
- package/src/__package__.ts +3 -3
- package/src/index.ts +34 -34
- 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 +238 -238
- 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 +171 -171
- package/src/leaflet/index.ts +18 -18
- package/src/test.ts +114 -114
package/src/GMapPin.ts
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import { GMapLayered } from "./GMapLayered";
|
|
2
|
-
import { Pins } from "./Pins";
|
|
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";
|
|
2
|
+
import { Pins } from "./Pins";
|
|
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,125 +1,125 @@
|
|
|
1
|
-
import { GMapLayered } from "./GMapLayered";
|
|
2
|
-
import { Lines } from "./Lines";
|
|
3
|
-
import { Pins } from "./Pins";
|
|
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
|
-
autoScale: { (): boolean; (_: boolean): GMapPinLine };
|
|
90
|
-
fromPinColor: { (): string; (_: string): GMapPinLine };
|
|
91
|
-
fromPinColor_exists: () => boolean;
|
|
92
|
-
fromLatitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
93
|
-
fromLatitudeColumn_exists: () => boolean;
|
|
94
|
-
fromLongitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
95
|
-
fromLongitudeColumn_exists: () => boolean;
|
|
96
|
-
fromColorColumn: { (): string; (_: string): GMapPinLine };
|
|
97
|
-
fromColorColumn_exists: () => boolean;
|
|
98
|
-
fromTooltipColumn: { (): string; (_: string): GMapPinLine };
|
|
99
|
-
fromTooltipColumn_exists: () => boolean;
|
|
100
|
-
toPinColor: { (): string; (_: string): GMapPinLine };
|
|
101
|
-
toPinColor_exists: () => boolean;
|
|
102
|
-
toLatitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
103
|
-
toLatitudeColumn_exists: () => boolean;
|
|
104
|
-
toLongitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
105
|
-
toLongitudeColumn_exists: () => boolean;
|
|
106
|
-
toColorColumn: { (): string; (_: string): GMapPinLine };
|
|
107
|
-
toColorColumn_exists: () => boolean;
|
|
108
|
-
toTooltipColumn: { (): string; (_: string): GMapPinLine };
|
|
109
|
-
toTooltipColumn_exists: () => boolean;
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
GMapPinLine.prototype._class += " map_GMapPinLine";
|
|
113
|
-
|
|
114
|
-
GMapPinLine.prototype.publish("autoScale", false, "boolean", "Auto scale to data");
|
|
115
|
-
GMapPinLine.prototype.publish("fromPinColor", "green", "html-color", "From Pin Color");
|
|
116
|
-
GMapPinLine.prototype.publish("fromLatitudeColumn", null, "set", "From Latitude", function () { return this.columns(); }, { optional: true });
|
|
117
|
-
GMapPinLine.prototype.publish("fromLongitudeColumn", null, "set", "From Longitude", function () { return this.columns(); }, { optional: true });
|
|
118
|
-
GMapPinLine.prototype.publish("fromColorColumn", null, "set", "From Color", function () { return this.columns(); }, { optional: true });
|
|
119
|
-
GMapPinLine.prototype.publish("fromTooltipColumn", null, "set", "From Tooltip", function () { return this.columns(); }, { optional: true });
|
|
120
|
-
|
|
121
|
-
GMapPinLine.prototype.publish("toPinColor", "red", "html-color", "To Pin Color");
|
|
122
|
-
GMapPinLine.prototype.publish("toLatitudeColumn", null, "set", "To Latitude", function () { return this.columns(); }, { optional: true });
|
|
123
|
-
GMapPinLine.prototype.publish("toLongitudeColumn", null, "set", "To Longitude", function () { return this.columns(); }, { optional: true });
|
|
124
|
-
GMapPinLine.prototype.publish("toColorColumn", null, "set", "To Color", function () { return this.columns(); }, { optional: true });
|
|
125
|
-
GMapPinLine.prototype.publish("toTooltipColumn", null, "set", "To Tooltip", function () { return this.columns(); }, { optional: true });
|
|
1
|
+
import { GMapLayered } from "./GMapLayered";
|
|
2
|
+
import { Lines } from "./Lines";
|
|
3
|
+
import { Pins } from "./Pins";
|
|
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
|
+
autoScale: { (): boolean; (_: boolean): GMapPinLine };
|
|
90
|
+
fromPinColor: { (): string; (_: string): GMapPinLine };
|
|
91
|
+
fromPinColor_exists: () => boolean;
|
|
92
|
+
fromLatitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
93
|
+
fromLatitudeColumn_exists: () => boolean;
|
|
94
|
+
fromLongitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
95
|
+
fromLongitudeColumn_exists: () => boolean;
|
|
96
|
+
fromColorColumn: { (): string; (_: string): GMapPinLine };
|
|
97
|
+
fromColorColumn_exists: () => boolean;
|
|
98
|
+
fromTooltipColumn: { (): string; (_: string): GMapPinLine };
|
|
99
|
+
fromTooltipColumn_exists: () => boolean;
|
|
100
|
+
toPinColor: { (): string; (_: string): GMapPinLine };
|
|
101
|
+
toPinColor_exists: () => boolean;
|
|
102
|
+
toLatitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
103
|
+
toLatitudeColumn_exists: () => boolean;
|
|
104
|
+
toLongitudeColumn: { (): string; (_: string): GMapPinLine };
|
|
105
|
+
toLongitudeColumn_exists: () => boolean;
|
|
106
|
+
toColorColumn: { (): string; (_: string): GMapPinLine };
|
|
107
|
+
toColorColumn_exists: () => boolean;
|
|
108
|
+
toTooltipColumn: { (): string; (_: string): GMapPinLine };
|
|
109
|
+
toTooltipColumn_exists: () => boolean;
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
GMapPinLine.prototype._class += " map_GMapPinLine";
|
|
113
|
+
|
|
114
|
+
GMapPinLine.prototype.publish("autoScale", false, "boolean", "Auto scale to data");
|
|
115
|
+
GMapPinLine.prototype.publish("fromPinColor", "green", "html-color", "From Pin Color");
|
|
116
|
+
GMapPinLine.prototype.publish("fromLatitudeColumn", null, "set", "From Latitude", function () { return this.columns(); }, { optional: true });
|
|
117
|
+
GMapPinLine.prototype.publish("fromLongitudeColumn", null, "set", "From Longitude", function () { return this.columns(); }, { optional: true });
|
|
118
|
+
GMapPinLine.prototype.publish("fromColorColumn", null, "set", "From Color", function () { return this.columns(); }, { optional: true });
|
|
119
|
+
GMapPinLine.prototype.publish("fromTooltipColumn", null, "set", "From Tooltip", function () { return this.columns(); }, { optional: true });
|
|
120
|
+
|
|
121
|
+
GMapPinLine.prototype.publish("toPinColor", "red", "html-color", "To Pin Color");
|
|
122
|
+
GMapPinLine.prototype.publish("toLatitudeColumn", null, "set", "To Latitude", function () { return this.columns(); }, { optional: true });
|
|
123
|
+
GMapPinLine.prototype.publish("toLongitudeColumn", null, "set", "To Longitude", function () { return this.columns(); }, { optional: true });
|
|
124
|
+
GMapPinLine.prototype.publish("toColorColumn", null, "set", "To Color", function () { return this.columns(); }, { optional: true });
|
|
125
|
+
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;
|
|
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;
|
|
15
|
+
}
|