0

I have layer settings of mapbox heatmap as follows from this official site:

enter image description here

What do these numbers stand for (the first, the second, the third, the fourth number) and what are their limitations please? (min, max)

In general there is written what the settings do, but how to customize them? I haven't found any detailed documentation link so far, just saw some basic results.

1 Answer 1

2

This is the Mapbox GL "expressions" syntax. This is a way for Mapbox GL to calculate a dynamic property value. It is a Lisp-style syntax. In the first case you have:

[
  "interpolate",
  ["linear"],
  ["get", "mag"],
  0, 0,
  6, 1
]

Which is a terse way of saying:

I want to interpolate a value linearly. The value should be based on the mag property. When mag is 0, I want the value to be 0. When mag is 6, I want the value to be 1. Between those two values, perform a linear interpolation.

There is no maximum or minimum value, but it should presumably be a finite number. In this example, if the value of the mag property was greater than 6, the output value would be capped at 1. Your heatmap-color property actually demonstrates a more complicated case: using more steps, and colour as the output.

The others are similar, but are based on the special zoom property (relating to the map's current zoom state).

Read more:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.