Don't animate aggregate map, just jump there.
This commit is contained in:
parent
dd50035a47
commit
3a747b2b1d
1 changed files with 4 additions and 3 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
var map = null;
|
|
||||||
// A map that can be used to locate a single point by setting its location explicitly
|
// A map that can be used to locate a single point by setting its location explicitly
|
||||||
// or by allowing the user to move a marker.
|
// or by allowing the user to move a marker.
|
||||||
class MapAggregate extends HTMLElement {
|
class MapAggregate extends HTMLElement {
|
||||||
|
|
@ -42,9 +41,11 @@ class MapAggregate extends HTMLElement {
|
||||||
center: centroid.coordinates,
|
center: centroid.coordinates,
|
||||||
container: mapElement,
|
container: mapElement,
|
||||||
style: "https://tiles.stadiamaps.com/styles/alidade_smooth.json",
|
style: "https://tiles.stadiamaps.com/styles/alidade_smooth.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", () => {
|
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