+static void map_apply_inline_styles(struct osm_object *o, struct style_results *r)
+{
+ char *name = NULL;
+
+ CLIST_FOR_EACH(struct osm_tag *, t, o->tags)
+ {
+ const char *key = osm_key_decode(t->key);
+ if (!strncmp(key, "style:", 6))
+ {
+ key += 6;
+ layer_t layer = STYLE_LAYER_DEFAULT;
+ char *sep = strstr(key, "::");
+ if (sep)
+ {
+ if (sep[2])
+ {
+ // XXX: Only layers defined in the main stylesheet can be modified
+ layer = style_layer_encode_if_exists(sep+2);
+ if (!layer)
+ goto skip;
+ }
+ int keylen = sep - key;
+ char *t = mp_alloc(r->pool, keylen+1);
+ memcpy(t, key, keylen);
+ t[keylen] = 0;
+ key = t;
+ }
+
+ if (!name)
+ name = mp_printf(r->pool, "Inline style in object #%ju", (uintmax_t) o->id);
+ struct style_prop *p= css_parse_prop(r->pool, name, key, osm_val_decode(t->val));
+ style_set_by_layer(r, layer, p);
+skip: ;
+ }
+ }
+}
+