Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Validate attribute selectors #76

Closed
springmeyer opened this issue Jul 8, 2011 · 4 comments
Closed

Validate attribute selectors #76

springmeyer opened this issue Jul 8, 2011 · 4 comments

Comments

@springmeyer
Copy link

Surprised we did not already have an issue for this, but ideally we can start validating the presence of FOO clientside for:

#layer[FOO=1] { ... }

This would be awesome to be kinder to folks like: https://github.com/mapbox/tilemill/issues/446

Now, Mapnik is designed to throw if FOO does not exist: http://trac.mapnik.org/ticket/792. A bigger (and interesting issue) is being able to set mapnik to 'graceful' mode so nothing actually throws at render time and instead the render functions could return an array of warnings/errors, like carto.

But, until that blue sky day, we should validate this in Carto. I figure the proper way to do it - so validation could work clientside would be to pre-populate an array of valid attribute names once a layer is added (which would be easy to grab via the node-mapnik bindings, once, serverside maybe with a tilemill api call?)

Thoughts?

@IvanSanchez
Copy link

Also see #460

@springmeyer
Copy link
Author

expressions are exposed in node-mapnik now, making this possible: mapnik/node-mapnik#58

@whitelynx
Copy link

@springmeyer: Is this still a valid issue?

@springmeyer
Copy link
Author

@springmeyer: Is this still a valid issue?

Current behavior is that TileMill/Mapbox Studio Classic will throw a modal error on an invalid expression at the time the XML is passed to Mapnik. This ticket is about trying to validate things at the MML -> XML stage. But doing that would require Carto have node-mapnik as a dependency, which is not ideal so this never moved and is not really actionable. Closing.

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

No branches or pull requests

3 participants