Geometry Library | Maps JavaScript API | Google for Developers (original) (raw)
encodingnamespace
google.maps.geometry.encoding
เนมสเปซ
ยูทิลิตีสําหรับการเข้ารหัสและการถอดรหัสรูปหลายเส้น
เข้าถึงโดยการโทรหา const {encoding} = await google.maps.importLibrary("geometry")
โปรดดูไลบรารีใน Maps JavaScript API
เมธอดแบบคงที่ | |
---|---|
decodePath | decodePath(encodedPath) พารามิเตอร์: encodedPath: string ผลลัพธ์: Array<LatLng> ถอดรหัสสตริงเส้นทางที่เข้ารหัสเป็นลําดับ LatLng |
encodePath | encodePath(path) พารามิเตอร์: path: Array<LatLng|LatLngLiteral> |
sphericalclass
google.maps.geometry.spherical
class
ฟังก์ชันยูทิลิตีสําหรับคํานวณมุม ระยะทาง และพื้นที่ตามแนวเส้นบอกทาง รัศมีเริ่มต้นคือรัศมีของโลก 6378137 เมตร
เข้าถึงโดยการโทรหา const {spherical} = await google.maps.importLibrary("geometry")
โปรดดูไลบรารีใน Maps JavaScript API
เมธอดแบบคงที่ | |
---|---|
computeArea | computeArea(path[, radiusOfSphere]) พารามิเตอร์: path: Array<LatLng|LatLngLiteral> |
computeDistanceBetween | computeDistanceBetween(from, to[, radius]) พารามิเตอร์: from: LatLng|LatLngLiteral to: LatLng |
computeHeading | computeHeading(from, to) พารามิเตอร์: from: LatLng|LatLngLiteral to: LatLng |
computeLength | computeLength(path[, radius]) พารามิเตอร์: path: Array<LatLng|LatLngLiteral> |
computeOffset | computeOffset(from, distance, heading[, radius]) พารามิเตอร์: from: LatLng|LatLngLiteral distance: number heading: number radius: number optional ผลลัพธ์: LatLng แสดงผล LatLng ที่เกิดจากการเคลื่อนที่เป็นระยะทางจากจุดเริ่มต้นในทิศทางที่ระบุ (แสดงเป็นองศาตามเข็มนาฬิกาจากเหนือ) |
computeOffsetOrigin | computeOffsetOrigin(to, distance, heading[, radius]) พารามิเตอร์: to: LatLng|LatLngLiteral distance: number heading: number radius: number optional ผลลัพธ์: LatLng |
computeSignedArea | computeSignedArea(loop[, radius]) พารามิเตอร์: loop: Array<LatLng|LatLngLiteral> |
interpolate | interpolate(from, to, fraction) พารามิเตอร์: from: LatLng|LatLngLiteral to: LatLng |
polyclass
google.maps.geometry.poly
class
ฟังก์ชันยูทิลิตีสําหรับการคํานวณที่เกี่ยวข้องกับรูปหลายเหลี่ยมและรูปหลายเส้น
เข้าถึงโดยการโทรหา const {poly} = await google.maps.importLibrary("geometry")
โปรดดูไลบรารีใน Maps JavaScript API
เมธอดแบบคงที่ | |
---|---|
containsLocation | containsLocation(point, polygon) พารามิเตอร์: point: LatLng|LatLngLiteral polygon: Polygon ผลลัพธ์: boolean คำนวณว่าจุดที่ระบุอยู่ภายในรูปหลายเหลี่ยมที่ระบุหรือไม่ |
isLocationOnEdge | isLocationOnEdge(point, poly[, tolerance]) พารามิเตอร์: point: LatLng|LatLngLiteral poly: Polygon |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-12-22 UTC