Skip to content

Instantly share code, notes, and snippets.

@letswritetw
Last active July 26, 2022 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letswritetw/e0a976d6e28bba31a68292bfe54eb04b to your computer and use it in GitHub Desktop.
Save letswritetw/e0a976d6e28bba31a68292bfe54eb04b to your computer and use it in GitHub Desktop.
leaflet-osm-basic
// *** 放置地圖
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