How to set the Mapbox symbol layer textfield with GeoJSON property value?

SoftwareStudent123 :

I want to create a symbol layer with the textfield set to a property from my GeoJSON file. For instance, in my GeoJSON file each Feature has a property called "rlabel" and I would like to set the value of this label as the symbol layers textfield. How do I do this?

String geojsonString = loadJsonFromDownloadedFile(...);
source = new GeoJsonSource("source-id", geojsonString);

SymbolLayer symbolLayer = new SymbolLayer("symbol-layer-id", "source-id");
symbolLayer.setProperties(
    PropertyFactory.textField(  ???   ) // what goes here?
);     
style.addLayer(symbolLayer);

Thanks

Tk30 :

Try the following code:

PropertyFactory.textField(get("rlabl"))

Specifically the get() method is com.mapbox.mapboxsdk.style.expressions.Expression.get() This class has a lot of matchers.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Access geojson property of a layer in a featuregroup in Mapbox

How to show GeoJson points layer from GeoDjango on MapBox

mapbox - how to set the popup options for a feature layer

mapbox set clickable to false in geoJSON

How to show dynamically retrieved GeoJSON using a ShapeSource and Circle layer for Mapbox using React-Native

How do I add a text-field from a geojson layer in Mapbox GL?

How to update layer in mapbox

How to set TextField property as small and fullwidth globally

How to assign an entered value on a TextField to a String property?

How can I get the value of a Symbol property

Using MapBox to add multiple GeoJSON sources to the same layer

Leaflet : setting icon for GeoJSON layer from GeoJSON property

How to set value to second page textfield from Main page textfield

How to set value of a Date Textfield in Material UI

how to set value style in center (at TextField Flutter)

How to set grouped TextField value to the state?

how to show datetimepicker and set the chosen value in textfield

How to get the type of Layer in Mapbox

How to set bias value of a particular layer in Keras

Sympy How To Set Value of every symbol in a list

MAPBOX- how to use minimum and maximum value of features from GeoJSON in Data Driven Styling

How to filter points in MapBox heatmap based on a property value?

How to show/hide raster layer (visibility property visible/none) at run time in react-native-mapbox-gl

Filtering GeoJSON on a feature property value

How to set the value property in AngularJS

How to set the value of property in Kotlin

How to set value to a property in Scala

How to randomly set property value

newline symbol in qml Textfield, text property not working