What is the label with height in mapbox-gl development?
Editor to share with you what is the high label in mapbox-gl development. I hope you will get something after reading this article. Let's discuss it together.
Except for fill-extrusion, the layers in mapbox-gl are placed close to the ground and have no height information.
Now we need to display a class of tags with height. In the github project of mapbox-gl, we found that one of the branches is to achieve this function, which can achieve a high degree of uniform setting of tags.
Select the corresponding branch and compare it with the code on the main branch to see where the source code has been modified: https://github.com/mapbox/mapbox-gl-js/compare/3993-z-offset
The main changes are as follows:
The symbol-z-offset attribute is added to layout to set the height of the label from the ground, and the value of this attribute is added to the two-dimensional coordinates in the source code.
In the shader transformation, the three-dimensional coordinate attribute vec3 a_projected_pos is entered.
The effect achieved is:
After reading this article, I believe you have a certain understanding of "what is a high label in mapbox-gl development". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!