Skip to content

Latest commit

 

History

History
185 lines (152 loc) · 4.16 KB

MAPSTYLE.md

File metadata and controls

185 lines (152 loc) · 4.16 KB

การเลือกใช้ map style

ในการเลือกใช้ style ของ map ให้กำหนด option style ในตอนสร้าง map แล้วใส่ชื่อ style ที่ต้องการ

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: '<MAP_STYLE>', 
});

รายชื่อ Map Styles

ตัวอย่าง map style

Almond

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'almond',
});

map style almond

Cha-Thai

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'cha-thai',
});

map style cha-thai

Charcoal

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'charcoal',
});

map style charcoal

Cloudy

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'cloudy',
});

map style cloudy

Hybrid

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'hybrid',
});

map style hybrid

Ivory

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'ivory',
});

map style hybrid

LightSteel

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'lightsteel',
});

map style lightsteel

Midnight

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'midnight',
});

map style midnight

Satellite

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'satellite',
});

map style satellite

Spearmint

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'spearmint',
});

map style spearmint

Terrain

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: 'terrain',
});

map style terrain

การกำหนดการแสดงภาษาบนแผนที่

ในการกำหนดการแสดงภาษาบนแผนที่ ให้กำหนด option lang ในตอนสร้าง map แล้วใส่อักษรย่อ ภาษา ที่ต้องการ ซึ่งในตอนนี้ map style รองรับภาษา ไทย อังกฤษ และ ไทย-อังกฤษ

ภาษา key ที่ใช้
ไทย (default) th
อังกฤษ en
ไทย-อังกฤษ th-en

ตัวอย่าง การเรียกใช้ภาษา ไทย อังกฤษ

const map = new mapmagic.Map({
  container: 'map',
  app_id: '<YOUR_APP_ID>',
  api_key: '<YOUR_API_KEY>',
  style: '<MAP_STYLE>',
  lang: 'th-en',
});

การแสดงผล

map th-en