Convert units
This is a modified version of the Streets template style.
Two new layers were added:
contourandcontour-label.The data for these two new layers comes from the
mapbox-terrain-v2tileset. Both layers can be added using the toggle buttons in the Terrain component.The
contour-labellayer is asymbollayer that uses a formula to convert elevation from meters to feet.
About this style
- Contour data: The contour data used in this example comes from the
mapbox-terrain-v2tileset. Thecontoursource layer contains the geometry for each contour line and two properties:indexandele. Theeleproperty is the elevation in meters. Read more about the Mapbox Terrain tileset in the vector tile reference documentation. - Layers tab: This example uses custom layers added and styled in the Layers tab.
- Two-layer approach: This example uses two different custom style layers from the same data source: a line layer called
contourand a symbol layer calledcontour-label.- The line layer,
contour, was added by adding a new layer and specifying thecontoursource layer from the Mapbox Terrain tileset as the source and creating alinelayer. Thecontourlayer uses the default styling for line layers. - The symbol layer,
contour-label, was added by duplicating thecontourline layer and changing the type of layer fromlinetosymbol.
- The line layer,
- Using formulas: The Text field for the
contour-labellayer uses a formula to calculate and display elevation in both meters and feet from theeledata property. Open thecontour-labellayer to see how the formula works.
Related resources
Looking for more guidance? Read our tutorials.
このexampleは役に立ちましたか?