mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.34k stars 1.33k forks source link

Display properties in glfw-linux-application #16676

Open wecand0 opened 11 months ago

wecand0 commented 11 months ago

Hello! My little team is writing an application in linux + glfw + maplibre gl, the performance of using pure c++ api is great! We stuck in one thing: how to display names of geojsons? For example we use this https://docs.mapbox.com/mapbox-gl-js/example/variable-label-placement/, as we undrestood we have to use text-field': ['get', 'description'] in layer so in c++ we write such thing ->

auto symbolLayer = std::make_unique<SymbolLayer>("poi-labels", "places");
symbolLayer->setTextField(PropertyExpression<expression::Formatted>(createExpression(R"(["get", "description"])")));

what is wrong..? geojson is correct!

Also tried in such way symbolLayer->setTextField(PropertyExpression<expression::Formatted>(get("description")));