ใน Google Maps พิกัดละติจูดและลองจิจูดที่กําหนดเส้นประกอบหรือรูปหลายเหลี่ยมจะจัดเก็บเป็นสตริงที่เข้ารหัส ดูคำอธิบายโดยละเอียดเกี่ยวกับการเข้ารหัส Polyline คุณอาจได้รับสตริงที่เข้ารหัสนี้ในการตอบกลับจาก Google API เช่น Directions API (เดิม)
คุณสามารถใช้ PolyUtil ในไลบรารียูทิลิตี Maps SDK สําหรับ Android เพื่อเข้ารหัสลําดับพิกัดละติจูด/ลองจิจูด ("LatLngs") เป็นสตริงเส้นทางที่เข้ารหัส และเพื่อถอดรหัสสตริงเส้นทางที่เข้ารหัสเป็นลําดับ LatLngs ซึ่งจะช่วยให้มั่นใจได้ว่าเว็บเซอร์วิสของ 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"]],["อัปเดตล่าสุด 2025-03-13 UTC"],[[["The Maps SDK for Android Utility Library is an open-source library offering advanced features for enhancing Google Maps in Android applications."],["It provides utilities for importing GeoJSON and KML data, adding heatmaps, clustering markers, managing multiple map layers, and working with polylines."],["The library includes features for customizing markers with bubble icons and performing spherical geometry calculations for distances, areas, and headings."],["Developers can quickly set up the library by following the provided setup guide and access detailed documentation for each utility."],["A demo app is included in the GitHub repository showcasing the usage of the various classes and functionalities within the library."]]],["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"]]