Default map to continental US
Because 0,0 is in the middle of the ocean
This commit is contained in:
parent
299b72eac3
commit
f8193f7354
1 changed files with 7 additions and 1 deletions
|
|
@ -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({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue