Mapbox aggregation, display different icons according to different states

If aggregation is preferred, you can refer to this official example:

Different icons are displayed according to different statuses. For example, my project needs are based on online and offline status. The icons are green and red respectively:

You can refer to this example in the official document:

 According to the following code and expression syntax, write your own code according to your own needs

 

Expression syntax:

 

The following is my detailed code;

 The following is the aggregate function code:

 

Effect picture:

 

Among them, the import code of the custom picture is as follows (one-stop haha):

 

Guess you like

Origin blog.csdn.net/qq_41588568/article/details/104501328