-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios, macos] Rename Data-driven styling guide #8627
[ios, macos] Rename Data-driven styling guide #8627
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, there’s a link to this guide in “Information for Style Authors” that needs to be updated.
|
||
Mapbox’s data-driven styling features allow you to use attributes in the data to style your maps. You can style map features automatically based on their individual attributes. | ||
Mapbox’s runtime and data-driven styling features allow you to style your maps as a function of the current map zoom level, attributes in the map source data, or both. With data-driven styling, you can style map features automatically based on their individual attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this article is specifically about an API (style functions) rather than a feature (data-driven styling), we should refocus the introduction around the style functions themselves. Here’s an introduction adapted from “Information for Style Authors”:
Runtime styling enables you to modify every aspect of the map’s appearance dynamically as a user interacts with your application. Much of the runtime styling API allows you to specify style functions instead of constant values. A style function allows you to specify in advance how a layout or paint attribute will vary as the zoom level changes or how the appearance of individual features varies based on metadata provided by a content source.
|
||
Mapbox’s data-driven styling features allow you to use attributes in the data to style your maps. You can style map features automatically based on their individual attributes. | ||
Mapbox’s runtime and data-driven styling features allow you to style your maps as a function of the current map zoom level, attributes in the map source data, or both. With data-driven styling, you can style map features automatically based on their individual attributes. | ||
|
||
Vary POI icons, transit route line colors, city polygon opacity, and more based on any attribute in your data. Need to visualize hotel data by price? You can have your map’s point radii and colors change automatically with your data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a technical document, so we should make the introduction sound less persuasive and more expository:
Style functions spare you the inconvenience of manually calculating intermediate values between different zoom levels or creating a multitude of style layers to handle homogeneous features in the map content. For example, if your content source indicates the prices of hotels in an area, you can color-code the hotels by price, relying on a style function to smoothly interpolate among desired colors without having to specify the color for each exact price.
Data-driven styling refers to the use of style functions to vary the map’s appearance based on data in a content source.
You can also specify style functions in a style JSON file, to be applied automatically when the map loads. See the Mapbox Style Specification for details.
@@ -4,15 +4,15 @@ | |||
Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`. | |||
--> | |||
|
|||
# Data-Driven Styling | |||
# Working with Style Functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guide talks about using style functions in conjunction with the runtime styling API, as opposed to using style functions in style JSON. Perhaps we should call this guide “Using Style Functions at Runtime”.
|
||
Vary POI icons, transit route line colors, city polygon opacity, and more based on any attribute in your data. Need to visualize hotel data by price? You can have your map’s point radii and colors change automatically with your data. | ||
|
||
![available bikes](img/data-driven-styling/citibikes.png) ![subway lines](img/data-driven-styling/polylineExample.png) | ||
|
||
This guide uses earthquake data from the [U.S. Geological Survey](https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php) to style a map based on attributes. For more information about how to work with GeoJSON data in our iOS SDK, please see our [working with GeoJSON data](working-with-geojson-data.html) guide. | ||
This guide uses earthquake data from the [U.S. Geological Survey](https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php) and data-driven styling to style a map based on attributes. For more information about how to work with GeoJSON data in our iOS SDK, please see our [working with GeoJSON data](working-with-geojson-data.html) guide. | ||
|
||
## Style functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s nix this heading, which is redundant, but change the following paragraph to the following:
A style function is represented at runtime by the
MGLStyleFunction
class. There are three subclasses ofMGLStyleFunction
:
platform/macos/CHANGELOG.md
Outdated
@@ -1,5 +1,9 @@ | |||
# Changelog for Mapbox macOS SDK | |||
|
|||
## 0.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1ec5 is 0.4.1 correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
platform/macos/CHANGELOG.md
Outdated
@@ -1,5 +1,9 @@ | |||
# Changelog for Mapbox macOS SDK | |||
|
|||
## 0.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
|
||
This guide uses earthquake data from the [U.S. Geological Survey](https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php) to style a map based on attributes. For more information about how to work with GeoJSON data in our iOS SDK, please see our [working with GeoJSON data](working-with-geojson-data.html) guide. | ||
![available bikes](img/data-driven-styling/citibikes.png) ![subway lines](img/data-driven-styling/polylineExample.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized the wording I suggested in #8627 (comment) eliminates language that leads into these images. Hopefully these images can stand on their own without explanation, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this!
c5f7409
to
ed5bd7c
Compare
This turns the Data-driven styling guide into a guide for working with style functions. This helps clarify that not all style functions are DDS specific but keeps the discussion of this related functionality in the same guide.
ed5bd7c
to
b1900c5
Compare
…or_merge * release-ios-v3.5.0-android-v5.0.0: (31 commits) [qt] Renamed qt5 formula to qt macos-v0.4.1 [ios] Update podspecs and changelog for v3.5.2 [ios, macos] Guard against looking up annotation contexts MGLAnnotationTagNotFound (mapbox#8686) [ios] Update podspecs and changelog for v3.5.1 [ios, macos] Hardened std::map usage in MGLMapVIew [ios] replaced link to select a feature example (mapbox#8651) [ios, macos] Rename Data-driven styling guide (mapbox#8627) [ios] assertion to check if an annotationTag > 0 (mapbox#8588) [ios, macos] Preserve symlinks when zipping framework [ios] Silence incompatible type warning for callout view (mapbox#8608) Release android v5.0.2 (mapbox#8629) [macos] Removed MGLUserTrackingMode from jazzy ToC [macos] Fixed broken images in DDS guide [core] cache binary shaders on Android [core] Extract and de-templatize several Program static methods macos-v0.4.0 [ios, macos] Updated changelogs [ios] Replaced UIActionSheet, UIAlertView with UIAlertController [ios, macos] Copyedited data-driven styling guides ...
This turns the Data-driven styling guide into a guide for working with style functions. This helps clarify that not all style functions are DDS specific but keeps the discussion of this related functionality in the same guide.