ในการเลือกใช้ 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>',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'almond',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'cha-thai',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'charcoal',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'cloudy',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'hybrid',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'ivory',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'lightsteel',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'midnight',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'satellite',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
style: 'spearmint',
});
const map = new mapmagic.Map({
container: 'map',
app_id: '<YOUR_APP_ID>',
api_key: '<YOUR_API_KEY>',
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',
});