Default map to continental US

Because 0,0 is in the middle of the ocean
This commit is contained in:
Eli Ribble 2026-03-14 16:55:40 +00:00
parent 299b72eac3
commit f8193f7354
No known key found for this signature in database

View file

@ -37,10 +37,16 @@ class MapMultipoint extends HTMLElement {
const ymin = parseFloat(this.getAttribute("ymin")); const ymin = parseFloat(this.getAttribute("ymin"));
const xmax = parseFloat(this.getAttribute("xmax")); const xmax = parseFloat(this.getAttribute("xmax"));
const ymax = parseFloat(this.getAttribute("ymax")); const ymax = parseFloat(this.getAttribute("ymax"));
const bounds = [ let bounds = [
[xmin, ymin], [xmin, ymin],
[xmax, ymax], [xmax, ymax],
]; ];
if (xmin == 0 || xmax == 0 || ymin == 0 || ymax == 0) {
bounds = [
[-125, 25],
[-70, 50],
];
}
const mapElement = this.shadowRoot.querySelector("#map"); const mapElement = this.shadowRoot.querySelector("#map");
this._map = new maplibregl.Map({ this._map = new maplibregl.Map({