Mapbox-gl-js: text-field properties

Created on 26 Aug 2016  路  4Comments  路  Source: mapbox/mapbox-gl-js

There are two questions:

  1. Is it possible to use two fields in "text-field" property? I tried like this but with no success:
    "text-field": "{name_main} {name_additional} "
  2. Does the text-field support any regular expressions? For example, if I want to replace some symbols in text strings (values of text-field) on my map.

All 4 comments

Hi @anna-geo, normally we reserve the issue tracker here for bug reports and feature requests. For support questions, please see https://www.mapbox.com/help/ or ask on Stack Overflow. But I'll answer these real quick:

  1. Yes, that should work. If you have a case where it isn't working please open an issue with a JSFiddle showing a minimal test case.
  2. Regular expression are not supported. See https://github.com/mapbox/mapbox-gl-style-spec/issues/321 for the issue requesting that.

Could you post a working example of #1? The jsfiddle link no longer works.

@FergusDevelopmentLLC The token syntax referenced in this ticket ({}) is deprecated. We recommend using the expression syntax now. Here's an example.

Thank you very much for the example. :+1:

Was this page helpful?
0 / 5 - 0 ratings