Move the map to fit the pools on selection
This commit is contained in:
parent
8e64ba8032
commit
3501c38deb
2 changed files with 38 additions and 2 deletions
|
|
@ -45,9 +45,11 @@ class MapMultipoint extends HTMLElement {
|
|||
center: centroid.coordinates,
|
||||
container: mapElement,
|
||||
style: "https://tiles.stadiamaps.com/styles/osm_bright.json",
|
||||
}).fitBounds(bounds, {
|
||||
padding: { top: 10, bottom: 10, left: 10, right: 10 },
|
||||
});
|
||||
let camera_transform = this._map.cameraForBounds(bounds, {
|
||||
padding: 10,
|
||||
});
|
||||
this._map.setZoom(camera_transform.zoom);
|
||||
this._map.on("load", () => {
|
||||
if (organization_id != 0) {
|
||||
this._map.addSource("tegola", {
|
||||
|
|
@ -110,6 +112,9 @@ class MapMultipoint extends HTMLElement {
|
|||
return this._map.queryRenderedFeatures(a);
|
||||
}
|
||||
|
||||
FitBounds(bounds, options) {
|
||||
return this._map.fitBounds(bounds, options);
|
||||
}
|
||||
SetLayoutProperty(layout, property, value) {
|
||||
return this._map.setLayoutProperty(layout, property, value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue