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

Add deprecation notice for paint classes #4038

Merged
merged 3 commits into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## master

#### Deprecation Notices
- [Class-specific paint properties](https://www.mapbox.com/mapbox-gl-style-spec/#layer-paint.*) are deprecated and will be removed in an upcoming release of Mapbox GL JS.

## 0.31.0 (Jan 10 2017)

#### New Features
Expand Down
10 changes: 10 additions & 0 deletions js/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ class Map extends Camera {
* in an HTML element's `class` attribute. To learn more about Mapbox style classes, read about
* [Layers](https://www.mapbox.com/mapbox-gl-style-spec/#layers) in the style specification.
*
* **Note:** Class-specific paint properties are deprecated and will be removed in an upcoming release of Mapbox GL JS.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding a util.warnOnce to the body of these methods?

* @param {string} klass The style class to add.
* @param {StyleOptions} [options]
* @fires change
Expand All @@ -273,6 +275,8 @@ class Map extends Camera {
/**
* Removes a Mapbox style class from the map.
*
* **Note:** Class-specific paint properties are deprecated and will be removed in an upcoming release of Mapbox GL JS.
*
* @param {string} klass The style class to remove.
* @param {StyleOptions} [options]
* @fires change
Expand All @@ -291,6 +295,8 @@ class Map extends Camera {
/**
* Replaces the map's existing Mapbox style classes with a new array of classes.
*
* **Note:** Class-specific paint properties are deprecated and will be removed in an upcoming release of Mapbox GL JS.
*
* @param {Array<string>} klasses The style classes to set.
* @param {StyleOptions} [options]
* @fires change
Expand All @@ -312,6 +318,8 @@ class Map extends Camera {
* Returns a Boolean indicating whether the map has the
* specified Mapbox style class.
*
* **Note:** Class-specific paint properties are deprecated and will be removed in an upcoming release of Mapbox GL JS.
*
* @param {string} klass The style class to test.
* @returns {boolean} `true` if the map has the specified style class.
*/
Expand All @@ -322,6 +330,8 @@ class Map extends Camera {
/**
* Returns the map's Mapbox style classes.
*
* **Note:** Class-specific paint properties are deprecated and will be removed in an upcoming release of Mapbox GL JS.
*
* @returns {Array<string>} The map's style classes.
*/
getClasses() {
Expand Down