0

Als ich die erste Google-API-URL mit Ursprung, Ziel und Wegpunkte ausführen, gibt esGoogle API-URL für Android kehrt ZERO_RESULTS

https://maps.googleapis.com/maps/api/directions/json?origin=9.6614981,80.02554649999999&waypoints=6.9040322,79.948803&destination=6.053518500000001,6.053518500000001%7C&sensor=false

{ 
    "geocoded_waypoints" : [ 
     {}, 
     {}, 
     { 
     "geocoder_status" : "ZERO_RESULTS" 
     } 
    ], 
    "routes" : [], 
    "status" : "NOT_FOUND" 
} 

Aber wenn ich diese zweite URL ausführen, das funktioniert perfekt fein.

https://maps.googleapis.com/maps/api/directions/json?origin=6.9146871,79.9711348&waypoint=6.9040322,79.948803%7C&destination=6.9058482,79.9248089&sensor=false

{ 
    "geocoded_waypoints" : [ 
     { 
     "geocoder_status" : "OK", 
     "place_id" : "ChIJnbKVwttW4joR96eguc1D88A", 
     "types" : [ "route" ] 
     }, 
     { 
     "geocoder_status" : "OK", 
     "place_id" : "ChIJnVoMvVZX4joRcAOUeZGMTUA", 
     "types" : [ "street_address" ] 
     } 
    ], 
    "routes" : [ 
     { 
     "bounds" : { 
      "northeast" : { 
       "lat" : 6.916328699999999, 
       "lng" : 79.972351 
      }, 
      "southwest" : { 
       "lat" : 6.9033429, 
       "lng" : 79.9247644 
      } 
     }, 
     "copyrights" : "Map data ©2017 Google", 
     "legs" : [ 
      { 
       "distance" : { 
        "text" : "6.9 km", 
        "value" : 6928 
       }, 
       "duration" : { 
        "text" : "18 mins", 
        "value" : 1109 
       }, 
       "end_address" : "19/7 Bogahahena Rd, Sri Jayawardenepura Kotte 10120, Sri Lanka", 
       "end_location" : { 
        "lat" : 6.9058178, 
        "lng" : 79.9247644 
       }, 
       "start_address" : "Pasan Mawatha, Malabe, Sri Lanka", 
       "start_location" : { 
        "lat" : 6.914893699999999, 
        "lng" : 79.9702508 
       }, 
       "steps" : [ 
        { 
        "distance" : { 
         "text" : "0.2 km", 
         "value" : 167 
        }, 
        "duration" : { 
         "text" : "1 min", 
         "value" : 50 
        }, 
        "end_location" : { 
         "lat" : 6.916328699999999, 
         "lng" : 79.97066389999999 
        }, 
        "html_instructions" : "Head \u003cb\u003enorth\u003c/b\u003e on \u003cb\u003ePasan Mawatha\u003c/b\u003e toward \u003cb\u003eWelivita Rd\u003c/b\u003e\u003cdiv style=\"font-size:0.9em\"\u003ePass by Boys Hostel (on the right)\u003c/div\u003e", 
        "polyline" : { 
         "points" : "[email protected]@GWEOEUKaAY{AWK?O?" 
        }, 
        "start_location" : { 
         "lat" : 6.914893699999999, 
         "lng" : 79.9702508 
        }, 
        "travel_mode" : "DRIVING" 
        }, 
        { 
        "distance" : { 
         "text" : "0.2 km", 
         "value" : 202 
        }, 
        "duration" : { 
         "text" : "1 min", 
         "value" : 42 
        }, 
        "end_location" : { 
         "lat" : 6.915699, 
         "lng" : 79.972351 
        }, 
        "html_instructions" : "Turn \u003cb\u003eright\u003c/b\u003e onto \u003cb\u003eWelivita Rd\u003c/b\u003e", 
        "maneuver" : "turn-right", 
        "polyline" : { 
         "points" : "[email protected]@[email protected][[email protected]@[email protected]@" 
        }, 
        "start_location" : { 
         "lat" : 6.916328699999999, 
         "lng" : 79.97066389999999 
        }, 
        "travel_mode" : "DRIVING" 
        }, 
        { 
        "distance" : { 
         "text" : "2.8 km", 
         "value" : 2757 
        }, 
        "duration" : { 
         "text" : "7 mins", 
         "value" : 426 
        }, 
        "end_location" : { 
         "lat" : 6.903943, 
         "lng" : 79.9549985 
        }, 
        "html_instructions" : "Turn \u003cb\u003eright\u003c/b\u003e at Petti Kade onto \u003cb\u003eB263\u003c/b\u003e\u003cdiv style=\"font-size:0.9em\"\u003ePass by Super Como Technologies (on the right)\u003c/div\u003e", 
        "maneuver" : "turn-right", 
        "polyline" : { 
         "points" : "[email protected]|@J`@[email protected]@[email protected][email protected]@^?rAAhAA\\[email protected][email protected]\\H\\[email protected]|[email protected]|@lC`@[email protected]@[email protected]@KZKVO\\KTM`@[email protected]^[email protected]@[email protected]@[email protected]@@PRZ`@JRL\\[email protected]^`[email protected]@[email protected]\\[email protected]@[email protected]^[email protected]@fA\\[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@TANCTE^[email protected]@[email protected]\\EZI`@[email protected]@[email protected]@[email protected]" 
        }, 
        "start_location" : { 
         "lat" : 6.915699, 
         "lng" : 79.972351 
        }, 
        "travel_mode" : "DRIVING" 
        }, 
        { 
        "distance" : { 
         "text" : "3.7 km", 
         "value" : 3722 
        }, 
        "duration" : { 
         "text" : "9 mins", 
         "value" : 564 
        }, 
        "end_location" : { 
         "lat" : 6.9052345, 
         "lng" : 79.9251951 
        }, 
        "html_instructions" : "At \u003cb\u003eMalabe\u003c/b\u003e, continue onto \u003cb\u003eකෝට්ටේ - බෝපේ පාර\u003c/b\u003e/\u003cb\u003eB240\u003c/b\u003e\u003cdiv style=\"font-size:0.9em\"\u003ePass by Megacity (on the left in 350 m)\u003c/div\u003e", 
        "polyline" : { 
         "points" : "[email protected][email protected]@CPCTERKZM\\[email protected]@[email protected]@[email protected]?HBPBVZnBD\\@[email protected]@[email protected]?J?F?HAH?HCFAHEJGLMZKV}@[email protected]@[email protected]@[email protected]`@[[email protected]@~AYfA]dAM^[email protected]@[email protected][email protected]@[email protected]@I`@I^I`@[email protected]@[email protected]@[email protected]\\[email protected]@@V?R?`@?^?`[email protected]@[email protected]@A`[email protected]`@@[email protected]@N\\[email protected]@[email protected]@[email protected]^@V?Z?^[email protected][email protected]@C^G`@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]^V" 
        }, 
        "start_location" : { 
         "lat" : 6.903943, 
         "lng" : 79.9549985 
        }, 
        "travel_mode" : "DRIVING" 
        }, 
        { 
        "distance" : { 
         "text" : "80 m", 
         "value" : 80 
        }, 
        "duration" : { 
         "text" : "1 min", 
         "value" : 27 
        }, 
        "end_location" : { 
         "lat" : 6.9058178, 
         "lng" : 79.9247644 
        }, 
        "html_instructions" : "Turn \u003cb\u003eright\u003c/b\u003e at okvel auto care onto \u003cb\u003eBogahahena Rd\u003c/b\u003e\u003cdiv style=\"font-size:0.9em\"\u003ePass by Waruna Motors (on the left)\u003c/div\u003e\u003cdiv style=\"font-size:0.9em\"\u003eDestination will be on the right\u003c/div\u003e", 
        "maneuver" : "turn-right", 
        "polyline" : { 
         "points" : "[email protected]@\\[email protected]" 
        }, 
        "start_location" : { 
         "lat" : 6.9052345, 
         "lng" : 79.9251951 
        }, 
        "travel_mode" : "DRIVING" 
        } 
       ], 
       "traffic_speed_entry" : [], 
       "via_waypoint" : [] 
      } 
     ], 
     "overview_polyline" : { 
      "points" : "[email protected][email protected]{AW[[email protected][email protected]@[email protected]@|@[email protected]@X|[email protected]@^^VZ\\[email protected]@[email protected]|[email protected]@[email protected]@[email protected][[email protected]@[email protected]@[email protected]@N`@[email protected]@\\[email protected]@[email protected]@[email protected]@[email protected]~AfAbCfA|[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@jBWvAC\\[email protected]`[email protected]@[email protected]][email protected]@[email protected]@xB]`@[email protected]@[email protected][email protected][email protected]^[email protected]@[email protected]@bCOlAA`@B\\H\\[email protected]@[email protected]@[email protected]@[email protected]?rAI|FIlA][email protected][email protected]\\XTR^[email protected]@[email protected]@RtA`ATVL^B\\E^[email protected]?\\F^R^[email protected]@^[email protected]\\[email protected]" 
     }, 
     "summary" : "B263 and කෝට්ටේ - බෝපේ පාර/B240", 
     "warnings" : [], 
     "waypoint_order" : [] 
     } 
    ], 
    "status" : "OK" 
} 

Was ist der Unterschied, wenn beide URL zu vergleichen, ich keine finden nicht scheinen kann. Bitte helfen Sie! Ich versuche, die Routen zwischen Ursprung und Ziel durch einen Wegpunkt zu zeichnen. Wie kann ich das erreichen? Vielen Dank!

+1

Der Unterschied ist der Dezimalpunkt in Koordinaten, die Sie geben. Um den genauen Punkt zu erhalten, schlägt Google vor, 7 Dezimalpunkte zu verwenden. –

+1

Überprüfen Sie diese Website: latlong.net. Sie können auch in Google Maps einchecken. Wenn Sie nach einem Ort suchen, überprüfen Sie den Link. Es enthält die Koordinaten mit 7 Dezimalstellen. Obwohl Sie 3 oder 4 oder 5 Dezimalpunkte verwenden können. Es sollte für Ursprung und Zielkoordinaten identisch sein. –

+0

Wenn es Ihnen klar gemacht hat, dann vergessen Sie nicht, den Kommentar zu aktualisieren. : P –

Antwort

1

Überprüfen Sie Ihr Reiseziel Latlng. Der erste Link, den Sie fragen, Navigation von Sri Lanka nach Nigeria (6,053518500000001,6,05351850000000). Ich denke, Sie fügen Mismatch-Ziel hinzu, dh Sie verwenden auch den gleichen Breitengradwert für die Länge. Überprüfen Sie Ihren Code.

+0

Ja! Das war der Fehler .. Danke für die Benachrichtigung ..: D –

Verwandte Themen