-
Notifications
You must be signed in to change notification settings - Fork 130
Confusion between 'id' and 'name' #165
Comments
I also just got confused by this. As far as TileMill it appears that |
Not sure what the action here would be - making carto pay attention to |
That seems right to me (only use |
@willwhite have any tips on why TileMill has both name and id? |
If it's possibly to only use |
ah, makes sense. Should be totally feasible then to use |
/cc @artemp who just hit this so he knows we plan on fixing |
Regarding backwards compatibility and a smooth transition I would propose the following: |
This is an issue I ran into in TileMill, and it could be worked around in that project, but it seems like more of a Carto issue.
If a layer is created in TileMill, the MML JSON object for that layer will have an 'id' and a 'name' key each with the same value. The id is what is used to show the layer name in the TileMill layers list, but it seems that Carto actually (confusingly) looks at the 'name' value for the
#layer
-style selectors. Given that in CSS the#
character is used to select theid
property, I think that's what Carto should do too.For example, an MML layer that has been manually edited to have
"id": "foo"
and"name": "bar"
will need the style selector#bar { }
in the MSS in order to render correctly. (The TileMill UI instead indicates that you should use#foo { }
in the layers list, and the code editor will autocomplete#foo
and not#bar
.)The text was updated successfully, but these errors were encountered: