Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ja robie POST- request z czymś takim:
- {
- "startPosition": {"lat":52.2288242, "lng":21.0130819},
- "endPosition" : {"lat":52.2285690, "lng":21.0155288},
- "travelMode": "DRIVING",
- "waypointPointsOfInterest" : [
- { "timeToSpend" : 600, "place_id":"ChIJ2X3Sqe7MHkcRA8bKf48xRgU" },
- { "timeToSpend" : 1200, "place_id":"ChIJZ6Mm9CvNHkcR8X0Q_rNKHTY" }
- ],
- "pointsOfInterestKeyword" : "restaurant"
- }
- Ty zwracasz mi coś takiego:
- {
- "travelTime" : 3600,
- "travelObject" : "....",
- "pointsOfInterestNearRoute" : ["ChIJv0QRf_HMHkcRv7d7R28ht3Q", "ChIJG_KN3PXMHkcR0MY-dNAZ2VQ", "ChIJ3-Fh5WbMHkcRaurfiNBDOVE"]
- }
- travelTime powinno byc w SEKUDNACH. Google maps zwykle zwraca jako czas unix timestamp czyli ilośćsekund od 1970, więc jestem zdania żebyśmy przekazywali sobie czas w sekundach.
- W travelObject powinna być jedna trasa określana przez DirectionsApi, czyli jeden element z array "routes". Przykładowo znajduje się on w
- https://maps.googleapis.com/maps/api/directions/json?origin=Piaseczno&destination=Warszawa&mode=driving&key=AIzaSyDCLwOaPymlOIpbOZcVZLzhqLZVHxaIbf8
- pointsOfInterestNearRoute - no niech będzie array skłądający się z place_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement