Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split source_tile in schema #5604

Merged
merged 9 commits into from
Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/roadmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const roadmap = {
"updated_at": "August 1, 2017",
"roadmap_items": [
{
"term": "Active development",
"term": "Active",
"description": "Things actively being built right now.",
"items": [
{
Expand Down
116 changes: 52 additions & 64 deletions docs/pages/style-spec.js

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions flow-typed/style-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,26 @@ declare type LightSpecification = {|
"intensity"?: PropertyValueSpecification<number>
|}

declare type TileSourceSpecification = {
"type": "vector" | "raster",
declare type VectorSourceSpecification = {
"type": "vector",
"url"?: string,
"tiles"?: Array<string>,
"bounds"?: [number, number, number, number],
"minzoom"?: number,
"maxzoom"?: number,
"tileSize"?: number
"attribution"?: string
}

declare type RasterSourceSpecification = {
"type": "raster",
"url"?: string,
"tiles"?: Array<string>,
"bounds"?: [number, number, number, number],
"minzoom"?: number,
"maxzoom"?: number,
"tileSize"?: number,
"scheme"?: "xyz" | "tms",
"attribution"?: string
}

declare type GeojsonSourceSpecification = {|
Expand Down Expand Up @@ -115,7 +127,8 @@ declare type CanvasSourceSpecification = {|
|}

declare type SourceSpecification =
| TileSourceSpecification
| VectorSourceSpecification
| RasterSourceSpecification
| GeojsonSourceSpecification
| VideoSourceSpecification
| ImageSourceSpecification
Expand Down
4 changes: 2 additions & 2 deletions src/source/raster_tile_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class RasterTileSource extends Evented implements Source {
tiles: Array<string>;

_loaded: boolean;
_options: TileSourceSpecification;
_options: RasterSourceSpecification;

constructor(id: string, options: TileSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {
constructor(id: string, options: RasterSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {
super();
this.id = id;
this.dispatcher = dispatcher;
Expand Down
4 changes: 2 additions & 2 deletions src/source/vector_tile_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class VectorTileSource extends Evented implements Source {
scheme: string;
tileSize: number;

_options: TileSourceSpecification;
_options: VectorSourceSpecification;
dispatcher: Dispatcher;
map: Map;
bounds: ?[number, number, number, number];
Expand All @@ -32,7 +32,7 @@ class VectorTileSource extends Evented implements Source {
reparseOverscaled: boolean;
isTileClipped: boolean;

constructor(id: string, options: TileSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {
constructor(id: string, options: VectorSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {
super();
this.id = id;
this.dispatcher = dispatcher;
Expand Down
6 changes: 6 additions & 0 deletions src/style-spec/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## master

* v6 styles are no longer supported.
* v7 styles are supported only for migration, not for validation.
* Split the `source_tile` entry in the JSON schema into `source_vector` and `source_raster`.

## 10.0.1

* Fix bug preventing @mapbox/mapbox-gl-style-spec package from being usable outside of mapbox-gl-js (#5502)
Expand Down
5 changes: 0 additions & 5 deletions src/style-spec/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
module.exports = function(style) {
let migrated = false;

if (style.version === 6) {
style = require('./migrate/v7')(style);
migrated = true;
}

if (style.version === 7 || style.version === 8) {
style = require('./migrate/v8')(style);
migrated = true;
Expand Down
225 changes: 0 additions & 225 deletions src/style-spec/migrate/v7.js

This file was deleted.

Loading