This example shows how to use the Legend plugin
to add a color legend to the map. Additionally, the example code shows how to read
elevation values at specific locations of the map using the
elevationAt property.
When presenting elevation values to the users, please note that the final elevation at a specific coordinate on the map is a distance-weighted sum of elevations of nearby points. Therefore, even the areas with no points may have non-zero elevations.
If you set the elevation property of each point on the elevations layer
to 1.0, the final map elevation values will roughly correspond
to the number of points in the nearest area.
All the code generating this visualization is inlined into the HTML page, view page source to see the code.