Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
declare const espUrl: string;
const connection = connect(espUrl);
const summaryQuery = connection instanceof Query ? connection : undefined;
export class RoxieSummary extends Leaflet.Leaflet {
_polyMap = new Leaflet.Polygons()
.columns(["polys", "weight"])
.polygonColumn("polys")
.weightColumn("weight")
.on("moveEnd", () => {
this.refresh();
})
;
protected _clusterMap = new Leaflet.ClusterCircles()
.columns(["latitude", "longitude", "weight"])
.latitudeColumn("latitude")
.longitudeColumn("longitude")
.weightColumn("weight")
.weightFormat(".0s")
;
constructor() {
super();
this
.layers([this._polyMap, this._clusterMap])
.mapType("Google")
.autoZoomToFit(false)
;
}
let y = 0;
for (let i = 0, j = points.length - 1; i < points.length; j = i, i++) {
const point1 = points[i];
const point2 = points[j];
const f = point1[0] * point2[1] - point2[0] * point1[1];
x += (point1[0] + point2[0]) * f;
y += (point1[1] + point2[1]) * f;
}
const f = area(points) * 6;
return [x / f, y / f];
}
export class RoxieRegion extends Leaflet.Leaflet {
protected _clusterMap = new Leaflet.ClusterCircles()
.columns(["latitude", "longitude", "weight"])
.latitudeColumn("latitude")
.longitudeColumn("longitude")
.weightColumn("weight")
.weightFormat("")
;
protected _pinsMap = new Leaflet.ClusterPins()
.columns(["latitude", "longitude", "payload"])
.latitudeColumn("latitude")
.longitudeColumn("longitude")
.tooltipColumn("payload")
.popupColumn("payload")
;
constructor() {
declare const espUrl: string;
const connection = connect(espUrl);
const summaryQuery = connection instanceof Query ? connection : undefined;
export class RoxieSummaryRegion extends Leaflet.Leaflet {
_polyMap = new Leaflet.Polygons()
.columns(["polys", "weight"])
.polygonColumn("polys")
.weightColumn("weight")
.on("moveEnd", () => {
this.refresh();
})
;
protected _clusterMap = new Leaflet.ClusterCircles()
.columns(["latitude", "longitude", "weight"])
.latitudeColumn("latitude")
.longitudeColumn("longitude")
.weightColumn("weight")
.weightFormat(".0s")
;
protected _pinsMap = new Leaflet.ClusterPins()
.columns(["latitude", "longitude", "payload"])
.latitudeColumn("latitude")
.longitudeColumn("longitude")
.tooltipColumn("payload")
.popupColumn("payload")
;
constructor() {