Add a layer opacity example

This commit is contained in:
Tim Schaub
2021-12-15 08:26:42 -07:00
parent 3643144108
commit 3f73a2f04f
2 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
---
layout: example.html
title: Layer Opacity
shortdesc: Adjust layer opacity based on user input
docs: >
The `layer.setOpacity()` method can be called to adjust the opacity of a layer.
tags: "opacity"
cloak:
- key: get_your_own_D6rA4zTHduk6KOKTXzGB
value: Get your own API key at https://www.maptiler.com/cloud/
---
<div id="map" class="map"></div>
<label>
Layer opacity
<input id="opacity-input" type="range" min="0" max="1" step="0.01" value="1" />
<span id="opacity-output"></span>
</label>