-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added separate debugger class so we can keep debugging statemen…
…t but not increase the plug-in size too much.
- Loading branch information
Showing
6 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* 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; | ||
|
||
logMarker(mLatName, mLat, x1Name, x1, x2Name, x2) { | ||
console.log(mLatName, mLat, x1Name, x1, x2Name, x2); | ||
} | ||
|
||
logger(...args) { | ||
console.log(args); | ||
} | ||
|
||
clearLog() { | ||
console.clear(); | ||
} | ||
|
||
drawNearbyPolygon(onMap, boundaryDef) { | ||
const markerCoords = [ | ||
{ lat: boundaryDef.x1, lng: boundaryDef.y1 }, | ||
{ lat: boundaryDef.x2, lng: boundaryDef.y1 }, | ||
{ lat: boundaryDef.x2, lng: boundaryDef.y2 }, | ||
{ lat: boundaryDef.x1, lng: boundaryDef.y2 }, | ||
|
||
{ lat: boundaryDef.x1, lng: boundaryDef.y1 }, | ||
]; | ||
|
||
// 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; | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters