mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-22 06:23:01 +00:00
Work on the proportions, but it's displaying upside-down!
...there's quite a ways to go.
This commit is contained in:
parent
d3978310b4
commit
6ce69098dc
4 changed files with 7 additions and 6 deletions
|
@ -17,7 +17,8 @@ class LayerDeviceMarkers {
|
||||||
this.device_data = in_device_data;
|
this.device_data = in_device_data;
|
||||||
|
|
||||||
// Create a new clustering layer
|
// Create a new clustering layer
|
||||||
this.layer = L.markerClusterGroup({
|
// this.layer = L.markerClusterGroup({
|
||||||
|
this.layer = L.layerGroup({
|
||||||
zoomToBoundsOnClick: false
|
zoomToBoundsOnClick: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class VoronoiManager {
|
||||||
.filter((device) => typeof device.latitude == "number" &&
|
.filter((device) => typeof device.latitude == "number" &&
|
||||||
typeof device.longitude == "number")
|
typeof device.longitude == "number")
|
||||||
.map((device) =>
|
.map((device) =>
|
||||||
new VoronoiCell(new Vector2(device.latitude, device.longitude))
|
new VoronoiCell(new Vector2(device.longitude, device.latitude))
|
||||||
));
|
));
|
||||||
this.overlay.add_to(map);
|
this.overlay.add_to(map);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { Delaunay } from 'd3-delaunay';
|
||||||
import Vector2 from '../Helpers/Vector2.mjs';
|
import Vector2 from '../Helpers/Vector2.mjs';
|
||||||
import Rectangle from '../Helpers/Rectangle.mjs';
|
import Rectangle from '../Helpers/Rectangle.mjs';
|
||||||
|
|
||||||
import SvgWriter from '../Helpers/SVGWriter.mjs';
|
import SvgWriter from '../Helpers/SvgWriter.mjs';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +42,7 @@ class VoronoiOverlay {
|
||||||
|
|
||||||
for(let cell of this.cells) {
|
for(let cell of this.cells) {
|
||||||
// TODO: Remove this restriction
|
// TODO: Remove this restriction
|
||||||
if(cell.point.x < 40) continue; // Exclude the freetown one for testing 'cause it's miles away
|
if(cell.point.y < 40) continue; // Exclude the freetown one for testing 'cause it's miles away
|
||||||
if(cell.point.x < result.x_min) result.x_min = cell.point.x;
|
if(cell.point.x < result.x_min) result.x_min = cell.point.x;
|
||||||
if(cell.point.x > result.x_max) result.x_max = cell.point.x;
|
if(cell.point.x > result.x_max) result.x_max = cell.point.x;
|
||||||
if(cell.point.y < result.y_min) result.y_min = cell.point.y;
|
if(cell.point.y < result.y_min) result.y_min = cell.point.y;
|
||||||
|
@ -112,8 +112,8 @@ class VoronoiOverlay {
|
||||||
this.layer = L.svgOverlay(
|
this.layer = L.svgOverlay(
|
||||||
SvgWriter.string2element(this.render()),
|
SvgWriter.string2element(this.render()),
|
||||||
L.latLngBounds(
|
L.latLngBounds(
|
||||||
L.latLng(bounds.TopLeft.x, bounds.TopLeft.y),
|
L.latLng(bounds.TopLeft.y, bounds.TopLeft.x),
|
||||||
L.latLng(bounds.BottomRight.x, bounds.BottomRight.y)
|
L.latLng(bounds.BottomRight.y, bounds.BottomRight.x)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
this.layer.addTo(map);
|
this.layer.addTo(map);
|
||||||
|
|
Loading…
Reference in a new issue