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

Is it possible to do data-driven styling? #96

Closed
chriswhong opened this issue Feb 2, 2017 · 5 comments
Closed

Is it possible to do data-driven styling? #96

chriswhong opened this issue Feb 2, 2017 · 5 comments

Comments

@chriswhong
Copy link

Maputnik is awesome, it perfectly fits our use case here at the NYC Department of City Planning where we are consuming MVTs from a self-hosted carto instance, but do not have an editor!

Is is possible to do data-driven styles? I am only seeing the option to pick a single color for a given layer. Thanks, and thanks for making this tool!

@muesliq
Copy link
Collaborator

muesliq commented Feb 3, 2017

To my knowledge it is not, yet you can always edit a layer's JSON by hand, adding those missing features by hand.

@chriswhong
Copy link
Author

chriswhong commented Feb 3, 2017 via email

@orangemug
Copy link
Collaborator

This is a feature I'd also be interested in. Out of interest has anybody thought about what the UI might look like for this?

@muesliq
Copy link
Collaborator

muesliq commented Mar 15, 2017

Probably similar to the stop functions which look like this:
screen shot 2017-03-15 at 15 26 22

Just that

  • the fields "property" and "type" above the stop lines would be needed
  • The "stops" fields wouldn't be numbers only

So it would look something like this:

Color              Property: [____________]
                   Type:    [exponential ▼]
        [DEL] [____________] [____________]
        [DEL] [____________] [____________]
                                 [Add stop]

What makes things really complicated is the need to be able to combine zoom functions and data driven styling, as in this example:

'line-offset': {
  	  'property': 'NAME',
  	  'type': 'categorical',
  	  'stops': [
  	    [{zoom: 10, value: 'LineA'}, 3],
  	    [{zoom: 10, value: 'LineB'}, 0],
  	    [{zoom: 10, value: 'LineC'}, -3],
  	    [{zoom: 14, value: 'LineA'}, 6],
  	    [{zoom: 14, value: 'LineB'}, 0],
  	    [{zoom: 14, value: 'LineC'}, -6]
  	  ]
  	}

I'm not sure what the ideal UI for such complexity would be. Maybe JSON is best for that, anyway.

@orangemug
Copy link
Collaborator

@pjsier added this as a part of #161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants