-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:mapbox/mapbox-gl-js into empty-style
# Conflicts: # src/ui/map.js
- Loading branch information
Showing
278 changed files
with
11,366 additions
and
2,725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ _site | |
yarn-error.log | ||
yarn-debug.log | ||
npm-debug.log | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// @flow | ||
|
||
import Benchmark from '../lib/benchmark'; | ||
import createMap from '../lib/create_map'; | ||
import type {StyleSpecification} from '../../src/style-spec/types'; | ||
|
||
export default class HillshadeLoad extends Benchmark { | ||
style: StyleSpecification; | ||
|
||
constructor() { | ||
super(); | ||
this.style = { | ||
"version": 8, | ||
"name": "Hillshade-only", | ||
"center": [-112.81596278901452, 37.251160384573595], | ||
"zoom": 11.560975632435424, | ||
"bearing": 0, | ||
"pitch": 0, | ||
"sources": { | ||
"mapbox://mapbox.terrain-rgb": { | ||
"url": "mapbox://mapbox.terrain-rgb", | ||
"type": "raster-dem", | ||
"tileSize": 256 | ||
} | ||
}, | ||
"layers": [ | ||
{ | ||
"id": "mapbox-terrain-rgb", | ||
"type": "hillshade", | ||
"source": "mapbox://mapbox.terrain-rgb", | ||
"layout": {}, | ||
"paint": {} | ||
} | ||
] | ||
}; | ||
} | ||
|
||
bench() { | ||
return createMap({ | ||
width: 1024, | ||
height: 1024, | ||
style: this.style, | ||
stubRender: false, | ||
showMap: true, | ||
idle: true | ||
}).then((map) => { | ||
map.remove(); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// @flow | ||
|
||
import Benchmark from '../lib/benchmark'; | ||
import createMap from '../lib/create_map'; | ||
import type Map from '../../src/ui/map'; | ||
|
||
const width = 1024; | ||
const height = 768; | ||
|
||
export default class Paint extends Benchmark { | ||
style: string; | ||
locations: Array<Object>; | ||
maps: Array<Map>; | ||
|
||
constructor(style: string, locations: Array<Object>) { | ||
super(); | ||
this.style = style; | ||
this.locations = locations; | ||
} | ||
|
||
setup(): Promise<void> { | ||
return Promise.all(this.locations.map(location => { | ||
return createMap({ | ||
zoom: location.zoom, | ||
width, | ||
height, | ||
center: location.center, | ||
style: this.style, | ||
idle: true | ||
}); | ||
})) | ||
.then(maps => { | ||
this.maps = maps; | ||
}) | ||
.catch(error => { | ||
console.error(error); | ||
}); | ||
} | ||
|
||
bench() { | ||
for (const map of this.maps) { | ||
const showCollisionBoxes = false; | ||
const fadeDuration = 300; | ||
const crossSourceCollisions = true; | ||
const forceFullPlacement = true; | ||
|
||
map.style._updatePlacement( | ||
map.transform, | ||
showCollisionBoxes, | ||
fadeDuration, | ||
crossSourceCollisions, | ||
forceFullPlacement); | ||
} | ||
} | ||
|
||
teardown() { | ||
for (const map of this.maps) { | ||
map.remove(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.