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

Keyword 'set' is not supported #46

Open
chnav opened this issue Feb 28, 2014 · 2 comments
Open

Keyword 'set' is not supported #46

chnav opened this issue Feb 28, 2014 · 2 comments

Comments

@chnav
Copy link

chnav commented Feb 28, 2014

Important keyword 'set' is not supported in declarations and classes.
http://wiki.openstreetmap.org/wiki/MapCSS/0.2#Declarations

e.g.
{ set tag=value; }
or
{ set .minor_road; }

produce an error:

[WARN] [mapcss-parser] Unsupported attribute 'set' was ignored!
0[ERROR] [parser] Parsing of file "mapcss\mymap.mapcss" failed:
[ERROR] [parser] Illegal syntax! Expected valid ":"!
[ERROR] [parser] In line 102 column 9:
[ERROR] [parser] ' set .minor_road;'
[ERROR] [parser] ^-here

@TheMarex
Copy link
Contributor

Yes, this is a know limitation. With the current architecture I think it would be rather challenging to add that, since we would need to add some external state to the matching routines to track modification of tags. (Basically we would need a hash-map that stores for each object which tags where overwritten)

Things that would be needed to do for this to work:

  • Extent the grammar to handle the new syntax
  • Add an unordered_map for ways, nodes, relations to src/server/stylesheet.cpp
  • Modify Selector interface (src/server/selectors/*) to take the unordered_map as parameter
  • Add code to src/server/selectors/apply_selector.cpp to add overrides to unordered_map
  • Fix each Selector to check for an override before using the actual values from "tags" unordered_map

@chnav
Copy link
Author

chnav commented Feb 28, 2014

Roger that, thanks.

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

2 participants