Skip to content

Instantly share code, notes, and snippets.

@YuukiToriyama
Created July 24, 2020 08:35
Show Gist options
  • Save YuukiToriyama/64e5e14b516edde2a220583d8955c2eb to your computer and use it in GitHub Desktop.
Save YuukiToriyama/64e5e14b516edde2a220583d8955c2eb to your computer and use it in GitHub Desktop.

これでL.Control.Opacityは使える

//MIERUNE MONO
const m_mono = new L.tileLayer("https://tile.mierune.co.jp/mierune_mono/{z}/{x}/{y}.png", {
    attribution: "Maptiles by <a href='http://mierune.co.jp/' target='_blank'>MIERUNE</a>, under CC BY. Data by <a href='http://osm.org/copyright' target='_blank'>OpenStreetMap</a> contributors, under ODbL."
});
m_mono.addTo(map);
L.control.opacity(m_mono, {label: "mierune mono"});
// 追加
var opacityControl = L.control.opacity(layer);
opacity.addTo(map);

// 削除
opacityControl.remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment