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

Update docs on removal of mapbox:// protocol #770

Merged
merged 1 commit into from
Jan 13, 2022
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
4 changes: 2 additions & 2 deletions src/geo/lng_lat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export const earthRadius = 6371008.8;
* A `LngLat` object represents a given longitude and latitude coordinate, measured in degrees.
* These coordinates are based on the [WGS84 (EPSG:4326) standard](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).
*
* Mapbox GL uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the
* MapLibre GL uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the
* [GeoJSON specification](https://tools.ietf.org/html/rfc7946).
*
* Note that any Mapbox GL method that accepts a `LngLat` object as an argument or option
* Note that any MapLibre GL method that accepts a `LngLat` object as an argument or option
* can also accept an `Array` of two numbers and will perform an implicit conversion.
* This flexible type is documented as {@link LngLatLike}.
*
Expand Down
14 changes: 7 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const exported = {
},

/**
* Clears browser storage used by this library. Using this method flushes the Mapbox tile
* Clears browser storage used by this library. Using this method flushes the MapLibre tile
* cache that is managed by this library. Tiles may still be cached by the browser
* in some cases.
*
Expand Down Expand Up @@ -189,32 +189,32 @@ const exported = {
Debug.extend(exported, {isSafari, getPerformanceMetrics: PerformanceUtils.getPerformanceMetrics});

/**
* The version of Mapbox GL JS in use as specified in `package.json`,
* The version of MapLibre GL JS in use as specified in `package.json`,
* `CHANGELOG.md`, and the GitHub release.
*
* @var {string} version
*/

/**
* Test whether the browser [supports Mapbox GL JS](https://www.mapbox.com/help/mapbox-browser-support/#mapbox-gl-js).
* Test whether the browser supports MapLibre GL JS.
*
* @function supported
* @param {Object} [options]
* @param {boolean} [options.failIfMajorPerformanceCaveat=false] If `true`,
* the function will return `false` if the performance of Mapbox GL JS would
* the function will return `false` if the performance of MapLibre GL JS would
* be dramatically worse than expected (e.g. a software WebGL renderer would be used).
* @return {boolean}
* @example
* // Show an alert if the browser does not support Mapbox GL
* // Show an alert if the browser does not support MapLibre GL
* if (!maplibregl.supported()) {
* alert('Your browser does not support Mapbox GL');
* alert('Your browser does not support MapLibre GL');
* }
* @see [Check for browser support](https://maplibre.org/maplibre-gl-js-docs/example/check-for-support/)
*/

/**
* Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text).
* Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left. Mapbox Studio loads this plugin by default.
* Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.
*
* @function setRTLTextPlugin
* @param {string} pluginURL URL pointing to the Mapbox RTL text plugin source.
Expand Down
2 changes: 1 addition & 1 deletion src/source/geojson_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type GeoJSONSourceOptions = GeoJSONSourceSpecification & {

/**
* A source containing GeoJSON.
* (See the [Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson) for detailed documentation of options.)
* (See the [Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources-geojson) for detailed documentation of options.)
*
* @example
* map.addSource('some id', {
Expand Down
6 changes: 3 additions & 3 deletions src/source/image_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export type Coordinates = [[number, number], [number, number], [number, number],

/**
* A data source containing an image.
* (See the [Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/#sources-image) for detailed documentation of options.)
* (See the [Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources-image) for detailed documentation of options.)
*
* @example
* // add to map
* map.addSource('some id', {
* type: 'image',
* url: 'https://www.mapbox.com/images/foo.png',
* url: 'https://www.maplibre.org/images/foo.png',
* coordinates: [
* [-76.54, 39.18],
* [-76.52, 39.18],
Expand All @@ -50,7 +50,7 @@ export type Coordinates = [[number, number], [number, number], [number, number],
*
* // update url and coordinates simultaneously
* mySource.updateImage({
* url: 'https://www.mapbox.com/images/bar.png',
* url: 'https://www.maplibre.org/images/bar.png',
* coordinates: [
* [-76.54335737228394, 39.18579907229748],
* [-76.52803659439087, 39.1838364847587],
Expand Down
2 changes: 1 addition & 1 deletion src/source/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const sourceTypes = {
*
* @param id
* @param {Object} source A source definition object compliant with
* [`mapbox-gl-style-spec`](https://www.mapbox.com/mapbox-gl-style-spec/#sources) or, for a third-party source type,
* [`maplibre-gl-style-spec`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources) or, for a third-party source type,
* with that type's requirements.
* @param {Dispatcher} dispatcher
* @returns {Source}
Expand Down
8 changes: 4 additions & 4 deletions src/source/vector_tile_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import type {VectorSourceSpecification, PromoteIdSpecification} from '../style-s

/**
* A source containing vector tiles in [Mapbox Vector Tile format](https://docs.mapbox.com/vector-tiles/reference/).
* (See the [Style Specification](https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/#vector) for detailed documentation of options.)
* (See the [Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/) for detailed documentation of options.)
*
* @example
* map.addSource('some id', {
* type: 'vector',
* url: 'mapbox://mapbox.mapbox-streets-v6'
* url: 'https://demotiles.maplibre.org/tiles/tiles.json'
* });
*
* @example
Expand All @@ -34,7 +34,7 @@ import type {VectorSourceSpecification, PromoteIdSpecification} from '../style-s
* });
*
* @example
* map.getSource('some id').setUrl("mapbox://mapbox.mapbox-streets-v6");
* map.getSource('some id').setUrl("https://demotiles.maplibre.org/tiles/tiles.json");
*
* @example
* map.getSource('some id').setTiles(['https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt']);
Expand Down Expand Up @@ -154,7 +154,7 @@ class VectorTileSource extends Evented implements Source {
/**
* Sets the source `url` property and re-renders the map.
*
* @param {string} url A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`.
* @param {string} url A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.
* @returns {VectorTileSource} this
*/
setUrl(url: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/source/video_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {VideoSourceSpecification} from '../style-spec/types';

/**
* A data source containing video.
* (See the [Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/#sources-video) for detailed documentation of options.)
* (See the [Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources-video) for detailed documentation of options.)
*
* @example
* // add to map
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 @@
## 15.0.0

### Breaking changes

* The migration to TypeScript [#209](https://github.com/maplibre/maplibre-gl-js/pull/209) removed support for the `mapbox://` protocol.

## 14.0.2

### ✨ Features and improvements
Expand Down
4 changes: 2 additions & 2 deletions src/style-spec/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function sortKeysBy(obj, reference) {
}

/**
* Format a Mapbox GL Style. Returns a stringified style with its keys
* Format a MapLibre GL Style. Returns a stringified style with its keys
* sorted in the same order as the reference style.
*
* The optional `space` argument is passed to
Expand All @@ -28,7 +28,7 @@ function sortKeysBy(obj, reference) {
* If `space` is unspecified, a default of `2` spaces will be used.
*
* @private
* @param {Object} style a Mapbox GL Style
* @param {Object} style a MapLibre GL Style
* @param {number} [space] space argument to pass to `JSON.stringify`
* @returns {string} stringified formatted JSON
* @example
Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@maplibre/maplibre-gl-style-spec",
"description": "a specification for maplibre gl styles",
"version": "14.0.2",
"version": "15.0.0",
"author": "MapLibre",
"keywords": [
"mapbox",
Expand Down
22 changes: 11 additions & 11 deletions src/style-spec/reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
"type": "sources",
"doc": "Data source specifications.",
"example": {
"mapbox-streets": {
"maplibre-demotiles": {
"type": "vector",
"url": "mapbox://mapbox.mapbox-streets-v6"
"url": "https://demotiles.maplibre.org/tiles/tiles.json"
}
}
},
Expand All @@ -76,7 +76,7 @@
"glyphs": {
"type": "string",
"doc": "A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
"example": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
"example": "https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf"
},
"transition": {
"type": "transition",
Expand Down Expand Up @@ -131,7 +131,7 @@
},
"url": {
"type": "string",
"doc": "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."
"doc": "A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."
},
"tiles": {
"type": "array",
Expand All @@ -148,7 +148,7 @@
180,
85.051129
],
"doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
"doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."
},
"scheme": {
"type": "enum",
Expand Down Expand Up @@ -210,7 +210,7 @@
},
"url": {
"type": "string",
"doc": "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."
"doc": "A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."
},
"tiles": {
"type": "array",
Expand All @@ -227,7 +227,7 @@
180,
85.051129
],
"doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
"doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."
},
"minzoom": {
"type": "number",
Expand Down Expand Up @@ -291,7 +291,7 @@
},
"url": {
"type": "string",
"doc": "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."
"doc": "A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."
},
"tiles": {
"type": "array",
Expand All @@ -308,7 +308,7 @@
180,
85.051129
],
"doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
"doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."
},
"minzoom": {
"type": "number",
Expand Down Expand Up @@ -1065,7 +1065,7 @@
"symbol-avoid-edges": {
"type": "boolean",
"default": false,
"doc": "If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.",
"doc": "If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.",
"sdk-support": {
"basic functionality": {
"js": "0.10.0",
Expand Down Expand Up @@ -3571,7 +3571,7 @@
}
},
"is-supported-script": {
"doc": "Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",
"doc": "Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in MapLibre GL JS).",
"group": "String",
"sdk-support": {
"basic functionality": {
Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/validate_style.min.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import validatePaintProperty from './validate/validate_paint_property';
import validateLayoutProperty from './validate/validate_layout_property';

/**
* Validate a Mapbox GL style against the style specification. This entrypoint,
* Validate a MapLibre GL style against the style specification. This entrypoint,
* `maplibre-gl-style-spec/lib/validate_style.min`, is designed to produce as
* small a browserify bundle as possible by omitting unnecessary functionality
* and legacy style specifications.
Expand Down
2 changes: 1 addition & 1 deletion src/symbol/shaping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('shaping', () => {
if (UPDATE) fs.writeFileSync(path.resolve(__dirname, '../../test/expected/text-shaping-newlines-in-middle.json'), JSON.stringify(shaped, null, 2));
expect(shaped).toEqual(expectedNewLinesInMiddle);

// Prefer zero width spaces when breaking lines. Zero width spaces are used by Mapbox data sources as a hint that
// Prefer zero width spaces when breaking lines. Zero width spaces are used by MapLibre data sources as a hint that
// a position is ideal for breaking.
const expectedZeroWidthSpaceBreak = require('../../test/expected/text-shaping-zero-width-space.json');

Expand Down
3 changes: 1 addition & 2 deletions src/ui/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type RequireAtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Pa
* // set the map's initial perspective with CameraOptions
* var map = new maplibregl.Map({
* container: 'map',
* style: 'mapbox://styles/mapbox/streets-v11',
* style: 'https://demotiles.maplibre.org/style.json',
* center: [-73.5804, 45.53483],
* pitch: 60,
* bearing: -60,
Expand Down Expand Up @@ -159,7 +159,6 @@ abstract class Camera extends Evented {
* var center = map.getCenter();
* // access longitude and latitude values directly
* var {lng, lat} = map.getCenter();
* @see Tutorial: [Use Mapbox GL JS in a React app](https://docs.mapbox.com/help/tutorials/use-mapbox-gl-js-with-react/#store-the-new-coordinates)
*/
getCenter(): LngLat { return new LngLat(this.transform.center.lng, this.transform.center.lat); }

Expand Down
4 changes: 2 additions & 2 deletions src/ui/control/attribution_control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ type AttributionOptions = {
};

/**
* An `AttributionControl` control presents the map's [attribution information](https://docs.mapbox.com/help/how-mapbox-works/attribution/).
* An `AttributionControl` control presents the map's attribution information.
*
* @implements {IControl}
* @param {Object} [options]
* @param {boolean} [options.compact] If `true`, force a compact attribution that shows the full attribution on mouse hover. If `false`, force the full attribution control. The default is a responsive attribution that collapses when the map is less than 640 pixels wide. **Attribution should not be collapsed if it can comfortably fit on the map. `compact` should only be used to modify default attribution when map size makes it impossible to fit [default attribution](https://docs.mapbox.com/help/how-mapbox-works/attribution/) and when the automatic compact resizing for default settings are not sufficient.**
* @param {boolean} [options.compact] If `true`, force a compact attribution that shows the full attribution on mouse hover. If `false`, force the full attribution control. The default is a responsive attribution that collapses when the map is less than 640 pixels wide. **Attribution should not be collapsed if it can comfortably fit on the map. `compact` should only be used to modify default attribution when map size makes it impossible to fit default attribution and when the automatic compact resizing for default settings are not sufficient.**
* @param {string | Array<string>} [options.customAttribution] String or strings to show in addition to any other attributions.
* @example
* var map = new maplibregl.Map({attributionControl: false})
Expand Down
2 changes: 1 addition & 1 deletion src/ui/control/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type Map from '../map';
* an exported method or class.
*
* Controls must implement `onAdd` and `onRemove`, and must own an
* element, which is often a `div` element. To use Mapbox GL JS's
* element, which is often a `div` element. To use MapLibre GL JS's
* default control styling, add the `maplibregl-ctrl` class to your control's
* node.
*
Expand Down
6 changes: 3 additions & 3 deletions src/ui/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ export type MapLibreZoomEvent = {
* `dataType`s are:
*
* - `'source'`: The non-tile data associated with any source
* - `'style'`: The [style](https://www.mapbox.com/mapbox-gl-style-spec/) used by the map
* - `'style'`: The [style](https://maplibre.org/maplibre-gl-js-docs/style-spec/) used by the map
*
* @typedef {Object} MapDataEvent
* @property {string} type The event type.
* @property {string} dataType The type of data that has changed. One of `'source'`, `'style'`.
* @property {boolean} [isSourceLoaded] True if the event has a `dataType` of `source` and the source has no outstanding network requests.
* @property {Object} [source] The [style spec representation of the source](https://www.mapbox.com/mapbox-gl-style-spec/#sources) if the event has a `dataType` of `source`.
* @property {Object} [source] The [style spec representation of the source](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources) if the event has a `dataType` of `source`.
* @property {string} [sourceDataType] Included if the event has a `dataType` of `source` and the event signals
* that internal data has been received or changed. Possible values are `metadata`, `content` and `visibility`.
* @property {Object} [tile] The tile being loaded or changed, if the event has a `dataType` of `source` and
Expand Down Expand Up @@ -1333,7 +1333,7 @@ export type MapEvent = /**
* map.on('styleimagemissing', function() {
* console.log('A styleimagemissing event occurred.');
* });
* @see [Generate and add a missing icon to the map](https://mapbox.com/mapbox-gl-js/example/add-image-missing-generated/)
* @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-missing-generated/)
*/ | 'styleimagemissing'

/**
Expand Down
Loading