ใน Google Maps ระบบจะจัดเก็บพิกัดละติจูดและลองจิจูดที่กำหนดเส้นประกอบหรือรูปหลายเหลี่ยมเป็นสตริงที่เข้ารหัส ดูคำอธิบายโดยละเอียดเกี่ยวกับการเข้ารหัสเส้นประกอบ คุณอาจได้รับสตริงที่เข้ารหัสนี้ในการตอบกลับจาก Google API เช่น Directions API (เดิม)
คุณสามารถใช้ PolyUtil ในไลบรารีของยูทิลิตี Maps SDK สำหรับ Android เพื่อเข้ารหัสลำดับพิกัดละติจูด/ลองจิจูด ("LatLng") เป็นสตริงเส้นทางที่เข้ารหัส และถอดรหัสสตริงเส้นทางที่เข้ารหัสเป็นลำดับ LatLng ซึ่งจะช่วยให้มั่นใจได้ว่าสามารถทำงานร่วมกับบริการบนเว็บของ Google Maps API ได้
คลาส StreetViewUtil มีฟังก์ชันการทำงานเพื่อตรวจสอบว่า Street View รองรับสถานที่ตั้งหรือไม่ คุณสามารถหลีกเลี่ยงข้อผิดพลาดเมื่อเพิ่มพาโนรามาใน Street View ลงในแอป Android ได้โดยเรียกใช้ยูทิลิตีข้อมูลเมตานี้ และเพิ่มพาโนรามาใน Street View เฉพาะในกรณีที่การตอบกลับเป็น OK
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2026-11-04 UTC"],[],["The Maps SDK for Android Utility Library offers tools for enhancing map functionality. Key actions include importing GeoJSON and KML data, adding heatmaps, managing marker clusters, and customizing markers with bubble icons. It supports adding multiple layers, and it also allows users to encode/decode polylines and utilize spherical geometry for distance, area, and heading calculations. Additionally, users can check if a location is supported in street view. All utilities are open-source, and can be viewed with the provided demo app.\n"]]