Last active
July 26, 2022 02:25
-
-
Save letswritetw/e0a976d6e28bba31a68292bfe54eb04b to your computer and use it in GitHub Desktop.
leaflet-osm-basic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// *** 放置地圖 | |
let zoom = 17; // 0 - 18 | |
let center = [xxx, xxx]; // 中心點座標 | |
let map = L.map('map').setView(center, zoom); | |
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
attribution: '© OpenStreetMap', // 商用時必須要有版權出處 | |
zoomControl: true , // 是否秀出 - + 按鈕 | |
}).addTo(map); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment