-
Notifications
You must be signed in to change notification settings - Fork 49
/
mapsed.debug.js
49 lines (39 loc) · 978 Bytes
/
mapsed.debug.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* Class to aid debugging without increasing the size of the core
* library too much. Including this file on the web page enables
* the improved debugging experience.
*/
class MapsedDebug {
#polygon = null;
logger(...args) {
console.log(args);
}
clearLog() {
console.clear();
}
drawNearbyPolygon(onMap, boundaryDef) {
const markerCoords = [
{ lat: boundaryDef.n, lng: boundaryDef.w },
{ lat: boundaryDef.s, lng: boundaryDef.w },
{ lat: boundaryDef.s, lng: boundaryDef.e },
{ lat: boundaryDef.n, lng: boundaryDef.e },
{ lat: boundaryDef.n, lng: boundaryDef.w },
];
// Construct the polygon.
this.#polygon = new google.maps.Polygon({
paths: markerCoords,
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF0000",
fillOpacity: 0.35,
});
this.#polygon.setMap(onMap);
}
clearPolygon() {
if (this.#polygon != null) {
this.#polygon.setMap(null);
this.#polygon = null;
}
}
}