Properly bound aggregate map without animation
This commit is contained in:
parent
fd93d3740b
commit
a4a6ab8f3a
1 changed files with 2 additions and 5 deletions
|
|
@ -38,14 +38,11 @@ class MapAggregate extends HTMLElement {
|
||||||
|
|
||||||
const mapElement = this.shadowRoot.querySelector("#map");
|
const mapElement = this.shadowRoot.querySelector("#map");
|
||||||
this._map = new maplibregl.Map({
|
this._map = new maplibregl.Map({
|
||||||
center: centroid.coordinates,
|
bounds: bounds,
|
||||||
container: mapElement,
|
container: mapElement,
|
||||||
style: "https://tiles.stadiamaps.com/styles/alidade_smooth.json",
|
style: "https://tiles.stadiamaps.com/styles/alidade_smooth.json",
|
||||||
});
|
});
|
||||||
let camera_transform = this._map.cameraForBounds(bounds, {
|
console.log("Initializing map to bounds", bounds);
|
||||||
padding: 10,
|
|
||||||
});
|
|
||||||
this._map.setZoom(camera_transform.zoom);
|
|
||||||
this._map.on("load", () => {
|
this._map.on("load", () => {
|
||||||
this._map.addSource("tegola", {
|
this._map.addSource("tegola", {
|
||||||
type: "vector",
|
type: "vector",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue