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 "placeholder-loading-*" properties #3694

Closed
wants to merge 4 commits into from
Closed

Conversation

lucaswoj
Copy link
Contributor

@lucaswoj lucaswoj commented Nov 23, 2016

Play with the demo!

This PR allows developers to show a pattern or color in lieu of a still-loading raster tile.

  • placeholder-loading-color
  • placeholder-loading-pattern
  • placeholder-loading-opacity

This feature is useful when loading raster tiles that use transparency to represent "no data." In the image below 👇 is there really no storm over SF? Or has the tile not loaded? Or has the tile errored?

screen shot 2016-11-23 at 3 20 25 pm

In some industries, there is a regulatory requirement that a pattern be shown to disambiuate between "no data", "data loading", and "data errored"

cc @lbud @jfirebaugh @mourner

fixes #3280

Launch Checklist

  • create a new style layer type
  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

@jfirebaugh
Copy link
Contributor

This would be useful for vector sources as well. Can we make it more general, taking into account the ideas in mapbox/mapbox-gl-style-spec#219?

@lucaswoj
Copy link
Contributor Author

I see the value in making this it's own layer type. That would give developers the ability to use this feature with vector tiles and control the z-ordering of the loading pattern.

Glomming this onto the raster layer type was just a prototyping expediency 😄

@lucaswoj lucaswoj force-pushed the loading-pattern branch 2 times, most recently from 3a5e73d to b80e66a Compare November 28, 2016 22:53
@lucaswoj
Copy link
Contributor Author

lucaswoj commented Nov 28, 2016

The latest commit adds a new layer type called source. I like how self-explanitory the property names are: source-loading-pattern, source-loading-opacity, etc.

Open to other naming ideas that convey a layer which displays source metadata, anticipating the need for errored-patterns in the near future. Also open to creating separate source-loading and source-errored layer types.

@lucaswoj lucaswoj changed the title Add "raster-loading-*" properties Add "source-loading-*" properties Nov 28, 2016
@lucaswoj lucaswoj changed the title Add "source-loading-*" properties Add "placeholder-loading-*" properties Dec 6, 2016
@lucaswoj
Copy link
Contributor Author

lucaswoj commented Dec 6, 2016

Updated to put the functionality on a new layer type called placeholder

  • placeholder-loading-color
  • placeholder-loading-pattern
  • placeholder-loading-opacity

Thoughts @jfirebaugh?

@lucaswoj
Copy link
Contributor Author

ping @jfirebaugh @lbud


I'm thinking about redoing the style spec such that it consists of

  • placeholder-color
  • placeholder-pattern
  • placeholder-opacity
  • placeholder-type: loading or errored

This will simplify the API and give users more control over layering order

@lucaswoj
Copy link
Contributor Author

Gonna take this back to the drawing board somewhat 😄

@lucaswoj lucaswoj closed this Jan 10, 2017
@lucaswoj lucaswoj deleted the loading-pattern branch January 10, 2017 20:08
@lucaswoj lucaswoj restored the loading-pattern branch January 10, 2017 20:08
@jfirebaugh jfirebaugh deleted the loading-pattern branch February 3, 2017 18:01
@lucaswoj lucaswoj mentioned this pull request Mar 21, 2017
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

raster layer "loading" pattern and "errored" pattern
2 participants