Skip to content

Commit

Permalink
Merge branch 'publisher-production' into docs-redesign
Browse files Browse the repository at this point in the history
* publisher-production: (115 commits)
  fix inter-documentation link (#7791)
  [docs] use docs subdomain in examples (#7789)
  Bump Publisher
  First shot at new-domain staging
  [docs] Update page shell (#7760)
  updates API docs links to new url structure (#7757)
  add mapbox-gl-utils to plugins (#7752)
  [docs] Use docs-page-shell (#7742)
  Fixes bugs in documentation (#7741)
  Add worldviews example (#7720)
  Update compatibility matrix for `fill-extrusion-vertical-gradient` for ios & macos. (#7712)
  updates mapbox-gl-directions version in example (#7719)
  v0.52.0
  cherry-pick color state fix to release branch (#7715)
  Update location of drone video used in examples.
  v0.52.0-beta.2
  Cache hillshade textures based on texture size, not tile size. (#7695)
  avoid incomplete webp support in Edge 18 (#7687) (#7692)
  only align raster sources to pixel grid when map is idle to prevent shaking (#7426) (#7694)
  Flattens nested single element all expressions when converting to expressions (#7679)
  ...
  • Loading branch information
Katy DeCorah committed Jan 23, 2019
1 parent 983fb4d commit bca1d4f
Show file tree
Hide file tree
Showing 245 changed files with 5,776 additions and 3,582 deletions.
10 changes: 5 additions & 5 deletions circle.yml → .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ workflows:

defaults: &defaults
docker:
- image: mbgl/ci:r4-linux-gl-js
- image: mbgl/80dbb7f452:linux
working_directory: ~/mapbox-gl-js

jobs:
Expand All @@ -99,11 +99,11 @@ jobs:
- checkout
- restore_cache:
keys:
- v1-yarn-{{ checksum "yarn.lock" }}
- v1-yarn
- v2-yarn-{{ checksum "yarn.lock" }}
- v2-yarn
- run: yarn
- save_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}
key: v2-yarn-{{ checksum "yarn.lock" }}
paths:
- '~/.yarn'
- 'node_modules'
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
steps:
- attach_workspace:
at: .
- run: yarn run build-min
- run: yarn run build-prod-min
- run: yarn run build-dev
- run: yarn run build-css
- run: yarn run build-style-spec
Expand Down
19 changes: 17 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,24 @@
"import"
],
"rules": {
// temporarily disabled due to https://github.com/babel/babel-eslint/issues/485
"no-use-before-define": "off",

// no-duplicate-imports doesn't play well with Flow
// https://github.com/babel/eslint-plugin-babel/issues/59
"no-duplicate-imports": "off",
"import/no-duplicates": "error",

// temporarily disabled for easier upgrading of dependencies
"implicit-arrow-linebreak": "off",
"arrow-parens": "off",
"arrow-body-style": "off",
"no-confusing-arrow": "off",
"no-control-regex": "off",
"no-invalid-this": "off",
"no-buffer-constructor": "off",

"array-bracket-spacing": "off",
"block-scoped-var": "error",
"consistent-return": "off",
"flowtype/define-flow-type": 1,
"flowtype/require-valid-file-annotation": [
Expand All @@ -34,7 +50,6 @@
"property": "assign"
}],
"no-unused-vars": ["error", {"argsIgnorePattern": "^_$"}],
"no-var": "error",
"no-warning-comments": "error",
"object-curly-spacing": "off",
"prefer-arrow-callback": "error",
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
.*/_site/.*

[version]
0.77.0
0.85.0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/dist/
/docs/pages/dist/mapbox-gl-dev.js
/docs/pages/dist/mapbox-gl.js
/docs/pages/dist/mapbox-gl-unminified.js
*.js.map
node_modules
package-lock.json
Expand Down
1 change: 1 addition & 0 deletions .publisher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subdomain: docs
59 changes: 58 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
## 0.52.0

# Breaking changes
* Canonicalize tile urls to `mapbox://` urls so they can be transformed with `config.API_URL` ([#7594](https://github.com/mapbox/mapbox-gl-js/pull/7594))

## Features and improvements
* Add getter and setter for `config.API_URL` ([#7594](https://github.com/mapbox/mapbox-gl-js/pull/7594))
* Allow user to define element other than map container for full screen control ([#7548](https://github.com/mapbox/mapbox-gl-js/pull/7548))
* Add validation option to style setters ([#7604](https://github.com/mapbox/mapbox-gl-js/pull/7604))
* Add 'idle' event: fires when no further rendering is expected without further interaction. ([#7625](https://github.com/mapbox/mapbox-gl-js/pull/7625))

## Bug fixes
* Fire error when map.getLayoutProperty references missing layer ([#7537](https://github.com/mapbox/mapbox-gl-js/issues/7537), fixed by [#7539](https://github.com/mapbox/mapbox-gl-js/pull/7539))
* Fix shaky sprites when zooming with scrolling ([#7558](https://github.com/mapbox/mapbox-gl-js/pull/7558))
* Fix layout problems in attribution control ([#7608](https://github.com/mapbox/mapbox-gl-js/pull/7608)) (h/t [lucaswoj](https://github.com/lucaswoj))
* Fixes resetting map's pitch to 0 if initial bounds is set ([#7617](https://github.com/mapbox/mapbox-gl-js/pull/7617)) (h/t [stepankuzmin](https://github.com/stepankuzmin))
* Fix occasional failure to load images after multiple image request abortions [#7641](https://github.com/mapbox/mapbox-gl-js/pull/7641)
* Update repo url to correct one ([#7486](https://github.com/mapbox/mapbox-gl-js/pull/7486)) (h/t [nicholas-l](https://github.com/nicholas-l))
* Fix bug where symbols were sometimes not rendered immediately ([#7610](https://github.com/mapbox/mapbox-gl-js/pull/7610))
* Fix bug where cameraForBounds returns incorrect CameraOptions with asymmetrical padding/offset ([#7517](https://github.com/mapbox/mapbox-gl-js/issues/7517), fixed by [#7518](https://github.com/mapbox/mapbox-gl-js/pull/7518)) (h/t [mike-marcacci](https://github.com/mike-marcacci))
* Use diff+patch approach to map.setStyle when the parameter is a URL ([#4025](https://github.com/mapbox/mapbox-gl-js/issues/4025), fixed by [#7562](https://github.com/mapbox/mapbox-gl-js/pull/7562))
* Begin touch zoom immediately when rotation disabled ([#7582](https://github.com/mapbox/mapbox-gl-js/pull/7582)) (h/t [msbarry](https://github.com/msbarry))
* Fix symbol rendering under opaque fill layers ([#7612](https://github.com/mapbox/mapbox-gl-js/pull/7612))
* Fix shaking by aligning raster sources to pixel grid only when map is idle ([7426](https://github.com/mapbox/mapbox-gl-js/pull/7426))
* Fix raster layers in Edge 18 by disabling it's incomplete WebP support ([7687](https://github.com/mapbox/mapbox-gl-js/pull/7687))
* Fix memory leak in hillshade layer ([7691](https://github.com/mapbox/mapbox-gl-js/pull/7691))
* Fix disappearing custom layers ([7711](https://github.com/mapbox/mapbox-gl-js/pull/7711))

## 0.51.0
November 7, 2018

### ✨ Features and improvements
* Add initial bounds as map constructor option ([#5518](https://github.com/mapbox/mapbox-gl-js/pull/5518)) (h/t [stepankuzmin](https://github.com/stepankuzmin))
* Improve performance on machines with > 8 cores ([#7407](https://github.com/mapbox/mapbox-gl-js/issues/7407), fixed by [#7430](https://github.com/mapbox/mapbox-gl-js/pull/7430))
* Add `MercatorCoordinate` type ([#7488](https://github.com/mapbox/mapbox-gl-js/pull/7488))
* Allow browser-native `contextmenu` to be enabled ([#2301](https://github.com/mapbox/mapbox-gl-js/issues/2301), fixed by [#7369](https://github.com/mapbox/mapbox-gl-js/pull/7369))
* Add an unminified production build to the NPM package ([#7403](https://github.com/mapbox/mapbox-gl-js/pull/7403))
* Add support for `LngLat` conversion from `{lat, lon}` ([#7507](https://github.com/mapbox/mapbox-gl-js/pull/7507)) (h/t [bfrengley](https://github.com/bfrengley))
* Add tooltips for navigation controls ([#7373](https://github.com/mapbox/mapbox-gl-js/pull/7373))
* Show attribution only for used sources ([#7384](https://github.com/mapbox/mapbox-gl-js/pull/7384))
* Add telemetry event to log map loads ([#7431](https://github.com/mapbox/mapbox-gl-js/pull/7431))
* **Tighten style validation**
* Disallow expressions as stop values ([#7396](https://github.com/mapbox/mapbox-gl-js/pull/7396))
* Disallow `feature-state` expressions in filters ([#7366](https://github.com/mapbox/mapbox-gl-js/pull/7366))

### 🐛 Bug fixes
* Fix for GeoJSON geometries not working when coincident with tile boundaries([#7436](https://github.com/mapbox/mapbox-gl-js/issues/7436), fixed by [#7448](https://github.com/mapbox/mapbox-gl-js/pull/7448))
* Fix depth buffer-related rendering issues on some Android devices. ([#7471](https://github.com/mapbox/mapbox-gl-js/pull/7471))
* Fix positioning of compact attribution strings ([#7444](https://github.com/mapbox/mapbox-gl-js/pull/7444), [#7445](https://github.com/mapbox/mapbox-gl-js/pull/7445), and [#7391](https://github.com/mapbox/mapbox-gl-js/pull/7391))
* Fix an issue with removing markers in mouse event callbacks ([#7442](https://github.com/mapbox/mapbox-gl-js/pull/7442)) (h/t [vbud](https://github.com/vbud))
* Remove controls before destroying a map ([#7479](https://github.com/mapbox/mapbox-gl-js/pull/7479))
* Fix display of Scale control values < 1 ([#7469](https://github.com/mapbox/mapbox-gl-js/pull/7469)) (h/t [MichaelHedman](https://github.com/MichaelHedman))
* Fix an error when using location `hash` within iframes in IE11 ([#7411](https://github.com/mapbox/mapbox-gl-js/pull/7411))
* Fix depth mode usage in custom layers ([#7432](https://github.com/mapbox/mapbox-gl-js/pull/7432)) (h/t [markusjohnsson](https://github.com/markusjohnsson))
* Fix an issue with shaky sprite images during scroll zooms ([#7558](https://github.com/mapbox/mapbox-gl-js/pull/7558))


## 0.50.0
October 10, 2018

Expand Down Expand Up @@ -73,7 +130,7 @@ August 16, 2018
* Treat tiles that error with status 404 as empty renderable tiles to prevent rendering duplicate features in some sparse tilesets ([#6803](https://github.com/mapbox/mapbox-gl-js/pull/6803))

### 🐛 Bug fixes
* Fix issue where `text-max-angle` property was being calculated incorrectly internally, causing potential rendering errors when `"text-placement": line`
* Fix issue where `text-max-angle` property was being calculated incorrectly internally, causing potential rendering errors when `"symbol-placement": line`
* Require `feature.id` when using `Map#setFeatureState` ([#6974](https://github.com/mapbox/mapbox-gl-js/pull/6974))
* Fix issue with removing the `GeolocateControl` when user location is being used ([#6977](https://github.com/mapbox/mapbox-gl-js/pull/6977)) (h/t [sergei-zelinsky](https://github.com/sergei-zelinsky))
* Fix memory leak caused by a failure to remove all controls added to the map ([#7042](https://github.com/mapbox/mapbox-gl-js/pull/7042))
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ A standalone build allows you to turn the contents of this repository into `mapb

To create a standalone build, run
```bash
yarn run build-min
yarn run build-prod-min
yarn run build-css
```

Expand Down
2 changes: 1 addition & 1 deletion batfish.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');
module.exports = () => {
const config = {
siteBasePath: '/mapbox-gl-js',
siteOrigin: 'https://www.mapbox.com',
siteOrigin: 'https://docs.mapbox.com',
pagesDirectory: `${__dirname}/docs/pages`,
outputDirectory: path.join(__dirname, '_site'),
browserslist: mapboxAssembly.browsersList,
Expand Down
4 changes: 2 additions & 2 deletions bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ By default, the benchmark page will compare the local branch against `master` an
Start the benchmark server

```bash
MAPBOX_ACCESS_TOKEN={YOUR MAPBOX ACCESS TOKEN} MAPBOX_STYLE_URL={YOUR STYLES HERE} yarn start
MAPBOX_ACCESS_TOKEN={YOUR MAPBOX ACCESS TOKEN} MAPBOX_STYLES={YOUR STYLES HERE} yarn start
```
Note: `MAPBOX_STYLE_URL` takes a comma-separated list of up to 3 Mapbox style URLs (e.g. `mapbox://styles/mapbox/streets-v10,mapbox://styles/mapbox/streets-v9`)
Note: `MAPBOX_STYLES` takes a comma-separated list of up to 3 Mapbox styles provided as a style URL or file system path (e.g. `./path/to/style.json,mapbox://styles/mapbox/streets-v10` or `mapbox://styles/mapbox/streets-v10,mapbox://styles/mapbox/streets-v9`)

To run all benchmarks, open [the benchmark page, `http://localhost:9966/bench/styles`](http://localhost:9966/bench/styles).

Expand Down
14 changes: 8 additions & 6 deletions bench/benchmarks/expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import spec from '../../src/style-spec/reference/latest';
import convertFunction from '../../src/style-spec/function/convert';
import { isFunction, createFunction } from '../../src/style-spec/function';
import { createPropertyExpression } from '../../src/style-spec/expression';
import { normalizeStyleURL } from '../../src/util/mapbox';
import fetchStyle from '../lib/fetch_style';

import type {StyleSpecification} from '../../src/style-spec/types';
import type {StylePropertySpecification} from '../../src/style-spec/style-spec';
import type {StylePropertyExpression} from '../../src/style-spec/expression';

Expand All @@ -19,21 +20,22 @@ class ExpressionBenchmark extends Benchmark {
compiledFunction: StylePropertyExpression,
compiledExpression: StylePropertyExpression
}>;
style: string;
style: string | StyleSpecification;

constructor(style: string) {
constructor(style: string | StyleSpecification) {
super();
this.style = style;
}

setup() {
return fetch(normalizeStyleURL(this.style))
.then(response => response.json())
return fetchStyle(this.style)
.then(json => {
this.data = [];

for (const layer of json.layers) {
if (layer.ref) {
// some older layers still use the deprecated `ref property` instead of `type`
// if we don't filter out these older layers, the logic below will cause a fatal error
if (!layer.type) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions bench/benchmarks/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function generateLayers(layer) {
const generated = [];
for (let i = 0; i < 50; i++) {
const id = layer.id + i;
generated.push(Object.assign({}, layer, {id: id}));
generated.push(Object.assign({}, layer, {id}));
}
return generated;
}
Expand Down Expand Up @@ -111,7 +111,7 @@ class LayerHeatmap extends LayerBenchmark {
sources: {
'heatmap': {
'type': 'geojson',
'data': data,
data,
'maxzoom': 23
}
},
Expand Down
5 changes: 3 additions & 2 deletions bench/benchmarks/layout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow

import type {StyleSpecification} from '../../src/style-spec/types';
import Benchmark from '../lib/benchmark';
import fetchStyle from '../lib/fetch_style';
import TileParser from '../lib/tile_parser';
Expand All @@ -8,10 +9,10 @@ import { OverscaledTileID } from '../../src/source/tile_id';
export default class Layout extends Benchmark {
tiles: Array<{tileID: OverscaledTileID, buffer: ArrayBuffer}>;
parser: TileParser;
style: string;
style: string | StyleSpecification;
locations: Array<OverscaledTileID>;

constructor(style: string, locations: ?Array<OverscaledTileID>) {
constructor(style: string | StyleSpecification, locations: ?Array<OverscaledTileID>) {
super();
this.style = style;
this.locations = locations || this.tileIDs();
Expand Down
4 changes: 2 additions & 2 deletions bench/benchmarks/paint_states.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function generateLayers(layer) {
const generated = [];
for (let i = 0; i < 50; i++) {
const id = layer.id + i;
generated.push(Object.assign({}, layer, {id: id}));
generated.push(Object.assign({}, layer, {id}));
}
return generated;
}
Expand All @@ -28,7 +28,7 @@ export default class PaintStates extends Benchmark {
.then(data => {
this.numFeatures = data.features.length;
return Object.assign({}, style, {
sources: {'land': {'type': 'geojson', 'data': data, 'maxzoom': 23}},
sources: {'land': {'type': 'geojson', data, 'maxzoom': 23}},
layers: generateLayers({
'id': 'layer',
'type': 'fill',
Expand Down
10 changes: 5 additions & 5 deletions bench/benchmarks/style_layer_create.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// @flow

import type {StyleSpecification} from '../../src/style-spec/types';
import Benchmark from '../lib/benchmark';
import createStyleLayer from '../../src/style/create_style_layer';
import deref from '../../src/style-spec/deref';
import { normalizeStyleURL } from '../../src/util/mapbox';
import fetchStyle from '../lib/fetch_style';

export default class StyleLayerCreate extends Benchmark {
style: string;
style: string | StyleSpecification;
layers: Array<Object>;

constructor(style: string) {
constructor(style: string | StyleSpecification) {
super();
this.style = style;
}

setup(): Promise<void> {
return fetch(normalizeStyleURL(this.style))
.then(response => response.json())
return fetchStyle(this.style)
.then(json => { this.layers = deref(json.layers); });
}

Expand Down
10 changes: 5 additions & 5 deletions bench/benchmarks/style_validate.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// @flow

import type {StyleSpecification} from '../../src/style-spec/types';
import Benchmark from '../lib/benchmark';
import validateStyle from '../../src/style-spec/validate_style.min';
import { normalizeStyleURL } from '../../src/util/mapbox';
import fetchStyle from '../lib/fetch_style';

export default class StyleValidate extends Benchmark {
style: string;
json: Object;
style: string | StyleSpecification;
json: StyleSpecification;

constructor(style: string) {
super();
this.style = style;
}

setup(): Promise<void> {
return fetch(normalizeStyleURL(this.style))
.then(response => response.json())
return fetchStyle(this.style)
.then(json => { this.json = json; });
}

Expand Down
47 changes: 47 additions & 0 deletions bench/benchmarks/symbol_layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// @flow

import Layout from './layout';
import SymbolBucket from '../../src/data/bucket/symbol_bucket';
import { performSymbolLayout } from '../../src/symbol/symbol_layout';
import { OverscaledTileID } from '../../src/source/tile_id';

export default class SymbolLayout extends Layout {
parsedTiles: Array<any>;

constructor(style: string, locations: ?Array<OverscaledTileID>) {
super(style, locations);
this.parsedTiles = [];
}

setup(): Promise<void> {
return super.setup().then(() => {
// Do initial load/parse of tiles and hold onto all the glyph/icon
// dependencies so that we can re-do symbol layout in isolation
// during the bench step.
return Promise.all(this.tiles.map(tile =>
this.parser.parseTile(tile, true).then((tileResult) => {
this.parsedTiles.push(tileResult);
})
)).then(() => {});
});
}

bench() {
let promise = Promise.resolve();
for (const tileResult of this.parsedTiles) {
promise = promise.then(() => {
for (const bucket of tileResult.buckets) {
if (bucket instanceof SymbolBucket) {
performSymbolLayout(bucket,
tileResult.glyphMap,
tileResult.glyphPositions,
tileResult.iconMap,
tileResult.imageAtlas.iconPositions,
false);
}
}
});
}
return promise;
}
}
Loading

0 comments on commit bca1d4f

Please sign in to comment.