Longdo เปิดให้นักพัฒนาสามารถเรียกใช้ ข้อมูลและบริการแผนที่ของ Longdo ในรูปแบบ Data as a Service (API) ได้สะดวกยิ่งขึ้น ไม่ว่าจะพัฒนาอยู่บนไลบรารีแผนที่ใดก็ตาม ทั้ง Leaflet, Mapbox GL, OpenLayers, MapTiler, MapLibre หรือ Google Maps ก็สามารถนำข้อมูลของ Longdo ไปใช้งานได้ทันที
หัวใจสำคัญของเรื่องนี้คือ ข้อมูลแผนที่ประเทศไทยที่ละเอียดและเป็นปัจจุบัน ของ Longdo รวมถึงบริการภูมิสารสนเทศอีกจำนวนมาก ซึ่งเปิดให้เรียกใช้ในรูปแบบ API ได้โดยตรง ที่ผ่านมาการนำบริการเหล่านี้ไปใช้จะสะดวกที่สุดผ่าน Longdo Map API ของเราเอง แต่นักพัฒนาจำนวนมากมีระบบเดิมที่พัฒนาด้วยไลบรารีแผนที่อื่นอยู่แล้ว และไม่ต้องการปรับเปลี่ยนระบบเดิม
ปัจจุบันข้อจำกัดดังกล่าวได้หมดไป ท่านไม่จำเป็นต้องเปลี่ยนไลบรารีที่ใช้งานอยู่ เพียงเพิ่มข้อมูลและบริการของ Longdo เข้าไปในโปรเจกต์เดิม ก็สามารถใช้งานทั้งชั้นข้อมูล แผนที่ ระบบค้นหา การคำนวณเส้นทาง ข้อมูลฝน และบริการอื่น ๆ ได้
บริการแผนที่ในรูปแบบ API ที่พร้อมให้ใช้งาน
- ระบบค้นหาข้อมูลแผนที่ (Smart Search) — แนะนำคำค้นอัตโนมัติเมื่อพิมพ์ครบ 3 ตัวอักษร, ค้นหาอัจฉริยะเมื่อกด Enter หรือค้นหาแบบเจาะจงเมื่อคลิกลิงก์ (Search / Suggest / Smart Search)
- แผนที่แบบเวกเตอร์ไทล์ (Vector Tiles) — เรียกใช้ข้อมูลแผนที่ Longdo ตามมาตรฐาน Mapbox Vector Tile (MVT) เพื่อความคมชัดและปรับแต่งสไตล์ได้อย่างยืดหยุ่น
- การคำนวณเส้นทาง (Routing) — คำนวณเส้นทางระหว่างจุดและแสดงผลเป็น GeoJSON หรือ Polyline บนชั้นข้อมูลแผนที่ของท่านได้โดยตรง
- ค้นหาที่อยู่จากพิกัด (Reverse Geocoding) — ดึงข้อมูลที่อยู่แบบเต็มและรายละเอียดจังหวัดจากพิกัดได้ทันที
- ข้อมูลฝนบนแผนที่ (Rain Radar Tiles) — เรียกใช้ข้อมูลเรดาร์ฝนจาก Longdo Weather มาแสดงซ้อนบนแผนที่
- สไตล์เวกเตอร์และแท็กสถานที่ (Vector Styles & Tags) — ปรับรูปแบบแผนที่แบบเวกเตอร์ พร้อมเปิด-ปิดการแสดงกลุ่มแท็กสถานที่ต่าง ๆ ได้ตามต้องการ
เริ่มต้นใช้งาน
หมายเหตุ: ก่อนใช้งานต้องขอ API Key ก่อน ดูขั้นตอนได้ที่บทความ วิธีสร้าง Longdo API Key สำหรับนักพัฒนา
เราได้รวบรวมตัวอย่างการเรียกใช้บริการเหล่านี้พร้อมโค้ดสำเร็จรูปไว้ในที่เดียวที่ส่วน Quick Start โดยมีแนวทางการใช้งานคือ เลือกบริการ เลือกไลบรารี คัดลอกโค้ด แล้วนำไปใช้งานได้ทันที ซึ่งแต่ละตัวอย่างประกอบด้วย:
- ตัวเลือกไลบรารี/เฟรมเวิร์ก (Longdo Map, Leaflet, Mapbox GL, OpenLayers, MapTiler, Google Maps, MapLibre)
- ตัวอย่างผลลัพธ์แบบเรียลไทม์ (Live Result) ที่แสดงผลได้ทันทีบนหน้าเดียวกัน
- ปุ่มคัดลอกโค้ด (Copy Code) และดูโค้ดแบบเต็ม (Show Full Code)
- ลิงก์ไปยังคู่มือและเอกสารที่เกี่ยวข้อง พร้อมปุ่มแชร์ลิงก์ของตัวอย่างนั้น ๆ
เหตุใดจึงสำคัญ
การเปลี่ยนแปลงนี้ช่วยให้ข้อมูลแผนที่และบริการภูมิสารสนเทศคุณภาพสูงของ Longdo เข้าถึงนักพัฒนาได้กว้างขวางยิ่งขึ้น ท่านสามารถนำข้อมูลแผนที่ประเทศไทยที่ละเอียด และได้รับการปรับปรุงอย่างสม่ำเสมอมาเสริมโปรเจกต์ของท่าน โดยไม่ต้องผูกติดกับไลบรารี หรือแพลตฟอร์มใดแพลตฟอร์มหนึ่ง
สำหรับผู้ใช้ AI (AI Coding Agents)
หากท่านพัฒนาโดยใช้ AI coding agent (เช่น Claude Code) Longdo ได้จัดเตรียม Longdo Skills ซึ่งเป็นชุดสกิลสำหรับ AI ที่รวบรวมรูปแบบการเขียนโค้ด แนวปฏิบัติ และข้อควรระวังของ Longdo API ไว้ เพียงกำหนดให้ agent ใช้สกิลที่ต้องการ ก็จะช่วยให้เขียนโค้ด Longdo ได้อย่างถูกต้องแม่นยำยิ่งขึ้น ครอบคลุมทั้ง Longdo Map JavaScript API, REST API (ค้นหา, geocode, routing, ข้อมูลจราจร), Flutter SDK และ Weather API
สามารถติดตั้งบน Claude Code ได้ด้วยคำสั่ง:
/plugin marketplace add MetamediaTechnology/longdo-skills
/plugin install longdo-map-js@longdo
ดูสกิลทั้งหมดได้ที่ github.com/MetamediaTechnology/longdo-skills และเนื่องจากแต่ละสกิลเป็นไฟล์ Markdown ในตัว จึงสามารถนำไปใช้กับ AI agent อื่นได้เช่นกัน
ทดลองใช้งาน
ดูตัวอย่างและคัดลอกโค้ดไปใช้ได้ที่ https://map.longdo.com/docs3/quick-start และหากยังไม่มี API Key สามารถขอรับได้ฟรีที่ Longdo API Console หรือศึกษาวิธีการสมัครได้จากบทความ วิธีสร้าง Longdo API Key สำหรับนักพัฒนา
แหล่งข้อมูลเพิ่มเติม: ตัวอย่างแผนที่ (Live Demo) · เคล็ดลับการใช้งาน Longdo Map API · คู่มือการใช้งานทั้งหมด
Longdo now makes it easier for developers to use Longdo’s map data and services as a Service (API), whatever mapping library you work with. Leaflet, Mapbox GL, OpenLayers, MapTiler, MapLibre, and Google Maps can all bring Longdo’s data directly into your project.
At the heart of this is Longdo’s detailed, up-to-date Thailand map data, together with a range of geospatial services, all available directly via API. Until now these were most convenient to use through our own Longdo Map API, yet many developers already have systems built on other mapping libraries and prefer not to rebuild them.
That barrier has now been removed. There is no need to switch away from the library you already use — simply add Longdo’s data and services to your existing project to access map layers, search, routing, rainfall data, and more.
Map services available as an API
- Smart Search — auto-suggestions after typing 3 characters, an intelligent search on Enter, or a specific lookup on click (Search / Suggest / Smart Search)
- Vector Tiles — consume Longdo map data using the Mapbox Vector Tile (MVT) standard for crisp visuals and flexible styling
- Routing — calculate routes between points and draw them as GeoJSON or Polyline directly on your own map layers
- Reverse Geocoding — retrieve a full address and province details from coordinates instantly
- Rain Radar Tiles — overlay live rainfall radar data from Longdo Weather on the map
- Vector Styles & Tags — customize the vector map style and toggle Longdo’s place-tag groups on or off as required
Getting started
Note: before you begin, you will need an API key. See how to create a Longdo API Key.
We have gathered ready-to-use examples for all of these in one place, in the Quick Start section. The approach is straightforward: choose a service, choose your library, copy the code, and integrate it into your project. Each example includes:
- A library/framework selector (Longdo Map, Leaflet, Mapbox GL, OpenLayers, MapTiler, Google Maps, MapLibre)
- A live result you can preview instantly on the same page
- Copy Code and Show Full Code buttons
- Links to the relevant documentation, plus a Share Link button for each example
Why it matters
This change opens Longdo’s high-quality maps and geospatial services to a much wider range of developers. You can bring detailed, regularly updated Thailand map data into your project without being tied to any single library or platform.
For AI users (AI coding agents)
If you build with an AI coding agent such as Claude Code, Longdo provides Longdo Skills — a set of AI-agent skills that capture the patterns, conventions, and considerations of the Longdo APIs. Point your agent at the skill you need and it will produce correct Longdo code. The skills cover the Longdo Map JavaScript API, the REST APIs (search, geocode, routing, traffic), the Flutter SDK, and the Weather API.
Install on Claude Code:
/plugin marketplace add MetamediaTechnology/longdo-skills
/plugin install longdo-map-js@longdo
See all the skills at github.com/MetamediaTechnology/longdo-skills. Each skill is self-contained Markdown, so it can be used with other AI agents as well.
Try it
Browse the examples and copy the code at https://map.longdo.com/docs3/quick-start. If you do not have an API key yet, you can get one for free from the Longdo API Console, or see our guide on how to create a Longdo API Key.
More resources: Live map demos · Longdo Map API tips · Full documentation
