เอกสาร MapScale
•••
ทดลองใช้งาน · แบบสด

Map sandbox

ปรับ style ของแผนที่จริง ไฮไลต์พื้นที่ และวางวัตถุบนแผนที่ แล้วคัดลอกโค้ดที่สร้างสิ่งที่คุณเห็นได้ทันที

สิ่งที่คุณจะทำได้

ทุกตัวควบคุมในหน้านี้ตรงกับพารามิเตอร์ของ API หรือคำสั่ง MapLibre จริง ไม่มีอะไรที่ใช้ได้เฉพาะในหน้านี้

ภาษา สี accent และการซ่อน layer เป็น query parameter ของ GET /styles/v1/streets การเปลี่ยนค่าจะดึง style document ใหม่จาก API

ภาษาของป้ายกำกับ
กลุ่ม layer
โค้ดของแผนที่นี้
const map = new maplibregl.Map({
  container: "map",
  style: "https://api.mapscale.io/styles/v1/streets?key=YOUR_PUBLISHABLE_KEY&lang=th&accent=0f766e",
  center: [100.5018, 13.7563],
  zoom: 11
})

// lang, accent and hide are style parameters — the server returns a
// different style document, so there is nothing to restyle client-side.

URL ของ style

ทุกอย่างในแท็บการจัดรูปแบบคือ query parameter เดียวกันนี้ เซิร์ฟเวอร์เป็นผู้ประกอบ style document ให้ ไม่ใช่เบราว์เซอร์

LIVE API PLAYGROUND

เข้าสู่ระบบหรือสร้างบัญชี

ดำเนินการต่อเพื่อเรียก request จริงจากหน้า docs

แก้ไข input ส่ง request จริง และตรวจสอบ response จริง

input ที่แก้ไขได้

6 ค่าที่เลือกได้
Request preview
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/styles/v1/streets?lang=th"
Response จริง
Response เริ่มต้น
{
  "status": "200",
  "contentType": "application/json",
  "description": "A MapLibre style document."
}

On this page