Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ubezi
web-ausstellung-virtuell.de
Commits
3556298d
Commit
3556298d
authored
Jan 04, 2018
by
Jonas Heinrich
Browse files
setMaxBounds after moveend of flight
parent
da290785
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/map.js
View file @
3556298d
...
...
@@ -16,45 +16,23 @@ var map = new mapboxgl.Map({
bearing
:
0
});
// maxBounds: bounds,
map
.
addControl
(
new
mapboxgl
.
NavigationControl
());
map
.
on
(
'
load
'
,
function
()
{
map
.
fire
(
'
flystart
'
);
map
.
flyTo
({
// These options control the ending camera position: centered at
// the target, at zoom level 9, and north up.
center
:
[
8.404
,
49.0150
],
zoom
:
17
,
pitch
:
40
,
bearing
:
20
,
// These options control the flight curve, making it move
// slowly and zoom out almost completely before starting
// to pan.
speed
:
0.5
,
// make the flying slow
curve
:
1
,
// change the speed at which it zooms out
// This can be any easing function: it takes a number between
// 0 and 1 and returns another number between 0 and 1.
speed
:
0.5
,
easing
:
function
(
t
)
{
return
t
;
}
});
map
.
on
(
'
moveend
'
,
function
(
e
){
if
(
flying
)
{
map
.
fire
(
'
flyend
'
);
}
});
map
.
on
(
'
flystart
'
,
function
(){
flying
=
true
;
});
map
.
on
(
'
flyend
'
,
function
(){
flying
=
false
;
map
.
setMaxBounds
(
bounds
);
});
// Insert the layer beneath any symbol layer.
...
...
@@ -77,7 +55,6 @@ map.on('load', function() {
'
minzoom
'
:
15
,
'
paint
'
:
{
'
fill-extrusion-color
'
:
'
#aaa
'
,
// use an 'interpolate' expression to add a smooth transition effect to the
// buildings as the user zooms in
'
fill-extrusion-height
'
:
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment