Skip to content
Discussion options

You must be logged in to vote

In ModelSymbol most of the properties are Expressions, so that means you can use JavaScript to access the feature data. For example

auto* model = style.getOrCreate<ModelSymbol>();
model->url() = StringExpression("return feature.properties.model_path;");
model->heading() = NumericExpression("return parseFloat(feature.properties.heading);";

Or in an earth file you would say

<style>
    default {
        model : feature.properties.model_path;
        model-heading : parseFloat(feature.properties.heading);
...

See the feature_models.earth example in the repo tests folder.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mikeucfl
Comment options

Answer selected by mikeucfl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants