Elevation Profile Control

The MapTiler elevation profile control module for MapTiler SDK is a super easy way to show the elevation profile of any GeoJSON trace; whether it’s a LineString or a MultiLineString, this trace can be in a Feature or FeatureCollection. If multiple features are eligible in the provided dataset, the features will be concatenated and displayed together as a unique route. MapTiler Cloud fuels the elevation data.

The elevation profile control is customizable in many ways and supports metric and imperial units. It has many built-in defaults and does not need much to look nice!

Get started

  1. Install the npm package.

  2. Import the MapTiler elevation profile control

  3. Instantiate the control and add it to a Map instance, most likely inside a map "load" event callback

API Reference

This reference documents every object and method available. Each section describes classes or objects as well as their properties, parameters, methods, and associated events. Many sections also include inline code examples and related resources.

Computing Elevation

Sometimes, the route data passed to the method .setData() will contain only longitude and latitude information but no elevation. In that case, the control will automatically fetch and compute the elevation data before displaying the profile. Under the hood, the MapTiler Client library performs this operation using elevation data from MapTiler Cloud.

Module Reference

On this page