MapScale API
เอกสารอ้างอิงจาก contract สำหรับ auth, parameters, response codes และตัวอย่าง curl
Autocomplete
คำแนะนำสถานที่สำหรับกล่องค้นหาและตัวเลือกบนแผนที่ คิด usage ตาม session
/v1/autocompleteเติมคำค้นหาสถานที่หรือที่อยู่
Autocomplete suggestions. Backed by Photon (v1) -> ES phonetic (v1.5). Billing SKU: autocomplete (per session, not per keystroke).
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
q | query | string | ใช่ |
lang | query | string | ไม่ |
session_token | query | string | ไม่ |
bbox | query | string | ไม่ |
proximity | query | string | ไม่ |
types | query | string | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/autocomplete?q=13.7563&lang=example&session_token=example"Geocoding
แปลงที่อยู่เป็นพิกัด แปลงพิกัดเป็นที่อยู่ ดู place detail และค้นหาเขตการปกครองไทย
/v1/admin-areas/reverseค้นหาเขตการปกครองไทยจากพิกัด
Point-in-polygon admin-area lookup over geography.* (PostGIS ST_Contains). Billing SKU: geocode.
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
point | query | string | ใช่ |
lang | query | string | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/admin-areas/reverse?point=13.7563&lang=example"/v1/geocodeแปลงชื่อสถานที่หรือที่อยู่เป็นพิกัด
Forward geocode. Backed by Photon /api. Billing SKU: geocode.
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
q | query | string | ใช่ |
lang | query | string | ไม่ |
limit | query | integer | ไม่ |
bbox | query | string | ไม่ |
proximity | query | string | ไม่ |
country | query | string | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/geocode?q=13.7563&lang=example&limit=example"/v1/place/{id}ดึงข้อมูลสถานที่จาก ID
Place details, by a photon:... id (from /v1/geocode or /v1/autocomplete) or a mapscale places.places uuid. Billing SKU: geocode (free if same session).
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
id | path | string | ใช่ |
lang | query | string | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/place/example-id?lang=example"/v1/reverseแปลงพิกัดเป็นที่อยู่
Reverse geocode. Backed by Photon /reverse, enriched with PostGIS admin-area names. Billing SKU: geocode.
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
point | query | string | ใช่ |
lang | query | string | ไม่ |
zoom | query | integer | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/reverse?point=13.7563&lang=example&zoom=example"Routes
เส้นทางและ isochrone จากข้อมูล routing ที่ปรับให้เหมาะกับประเทศไทย
/v1/isochroneสร้างพื้นที่ตามเวลาเดินทาง
Time/distance reachability polygons around a point. Backed by Valhalla /isochrone. Billing SKU: routing.
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
point | query | string | ใช่ |
profile | query | string | ไม่ |
contours | query | string | ใช่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/isochrone?point=13.7563&profile=example&contours=100.5018"/v1/routeคำนวณเส้นทางด้วย query parameters
Route between 2+ waypoints. Backed by Valhalla /route. Billing SKU: routing.
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
coordinates | query | string | ใช่ |
profile | query | string | ไม่ |
alternatives | query | boolean | ไม่ |
lang | query | string | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/route?coordinates=13.7563&profile=example&alternatives=example"/v1/routeคำนวณเส้นทางด้วย JSON body
Route between 2+ waypoints. Backed by Valhalla /route. Billing SKU: routing.
curl \
-X POST \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/route"Matrix
ตารางเวลาเดินทางและระยะทางสำหรับ dispatch, ranking และตรวจ coverage
/v1/matrixคำนวณ route matrix
Travel-time/distance matrix, capped at 25x25 in v1. Backed by Valhalla /sources_to_targets. Billing SKU: matrix (per element).
curl \
-X POST \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/matrix"Tiles
Vector tiles สำหรับแผนที่แบบ interactive บน MapLibre
/tiles/v1/{tileset}/{z}/{x}/{yFile}ดึง vector tile
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
tileset | path | string | ใช่ |
z | path | integer | ไม่ |
x | path | integer | ไม่ |
yFile | path | string | ใช่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/tiles/v1/example-tileset/1/1/example.json"Static maps
ภาพแผนที่ที่ render จาก server สำหรับ preview, email และการแชร์
/v1/static/{lonLatZoom}/{sizeFile}เรนเดอร์ภาพแผนที่แบบ static
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
lonLatZoom | path | string | ใช่ |
sizeFile | path | string | ใช่ |
styleId | query | string | ไม่ |
lang | query | string | ไม่ |
accent | query | string | ไม่ |
markers | query | string | ไม่ |
path | query | string | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/static/example-lonLatZoom/example.json?styleId=example&lang=example&accent=example"Styles
เอกสาร MapLibre style ที่อ้างถึง tiles, glyphs และ sprites ของ MapScale
/styles/v1/{styleId}ดึง MapLibre style
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
styleId | path | string | ใช่ |
lang | query | string | ไม่ |
accent | query | string | ไม่ |
hide | query | string[] | string | ไม่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/styles/v1/example-styleId?lang=example&accent=example&hide=example"Glyphs และ sprites
ชุดฟอนต์และ sprite assets ที่ MapLibre style ใช้งาน
/fonts/v1/{fontstack}/{rangeFile}ดึงชุด glyph ของฟอนต์
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
fontstack | path | string | ใช่ |
rangeFile | path | string | ใช่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/fonts/v1/example-fontstack/0-255.pbf"/sprites/v1/{styleId}/{filename}ดึงไฟล์ sprite ของแผนที่
| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น |
|---|---|---|---|
styleId | path | string | ใช่ |
filename | path | string | ใช่ |
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/sprites/v1/example-styleId/example.json"Health และ contract
endpoint ตรวจสถานะและ OpenAPI document แบบ public
/v1/healthตรวจสอบว่า service ยังทำงานอยู่
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/health"/v1/statusตรวจสอบสถานะ dependency
curl \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/status"/v1/trial-keyสร้าง publishable trial key แบบจำกัดการใช้งาน
Creates a trial account and a browser-safe `pk_test_*` key for client-side MapScale integration. The key is restricted to tiles, autocomplete and static maps.
curl \
-X POST \
-H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/trial-key"