NEWS
request bringt Fehler von Google Maps API [gelöst]
-
Ich versuche mit der Maps-API die Fahrtzeit einer Route auszulesen.
Das (einfache) Blockly liefert leider kein bzw. ein Fehler-Ergebnis:
Die gleiche URL in den Browser kopiert liefert das gewünschte json:
Weiß wer, warum die Abfrage in Blockly nicht zu dem gewünschten Ergebnis führt?
hier noch das Blockly:
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="*fmtRW#jX(HGq:[u?:pg">result</variable>
</variables>
<block type="request" id="Zi-.ja.?F-5Te)1dKXTE" x="288" y="113">
<mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation>
<field name="WITH_STATEMENT">TRUE</field>
<field name="LOG"></field>
<value name="URL">
<shadow type="text" id="b[r1P0U%if9a:.CXSjZH">
<field name="TEXT">text</field>
</shadow>
<block type="text" id="P;TTrse`nD25wTTfPxF+">
<field name="TEXT">https://maps.googleapis.com/maps/api/distancematrix/json?origins=Ottweiler,Spitalstraße+75&destinations=Homburg,Talstraße+52&mode=driving&language=de-DE&arrival_time=1669035600000&key=AIzaSyCIGLAwUf2iT8K_hnh51wexjL1xtZl3dOg</field>
</block>
</value>
<statement name="STATEMENT">
<block type="debug" id="]eURFC^9qO|+0Z.j/Ww1">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="g=FhBHexvbmA%*Qi{5vW">
<field name="TEXT">test</field>
</shadow>
<block type="variables_get" id="wPZ6rCvvE(iU${c[/6s4">
<field name="VAR" id="*fmtRW#jX(HGq:[u?:pg">result</field>
</block>
</value>
</block>
</statement>
</block>
</xml> -
@jr28 sagte in request bringt Fehler von Google Maps API:
keine Ahnung aber hier läufts:
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="!(RmIf;iE,=3e^U:NX,$">result</variable> </variables> <block type="request" id="~]gb!%$3zv`-a+Y)~=xX" x="-438" y="-512"> <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation> <field name="WITH_STATEMENT">TRUE</field> <field name="LOG"></field> <value name="URL"> <shadow type="text" id="rnw}tZ/[l*u)`VS8gOso"> <field name="TEXT">text</field> </shadow> <block type="text" id="N2bw+no|+]}wfvJ@rl5u"> <field name="TEXT">https://maps.googleapis.com/maps/api/distancematrix/json?origins=Ottweiler,Spitalstra%C3%9Fe+75&destinations=Homburg,Talstra%C3%9Fe+52&mode=driving&language=de-DE&arrival_time=1669035600000&key=AIzaSyCIGLAwUf2iT8K_hnh51wexjL1xtZl3dOg</field> </block> </value> <statement name="STATEMENT"> <block type="debug" id="p%!E2/#@GDByGwN11!UU"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="wJXo3S}SIj}#yE0b`F/,"> <field name="TEXT">test</field> </shadow> <block type="variables_get" id="W+0LC81`XJjC;~|mmB5L"> <field name="VAR" id="!(RmIf;iE,=3e^U:NX,$">result</field> </block> </value> </block> </statement> </block> </xml>
LOG:
{ "destination_addresses" : [ "Talstraße 52, 66424 Homburg, Deutschland" ], "origin_addresses" : [ "Spitalstraße 75, 66564 Ottweiler, Deutschland" ], "rows" : [ { "elements" : [ { "distance" : { "text" : "21,6 km", "value" : 21566 }, "duration" : { "text" : "25 Minuten", "value" : 1470 }, "status" : "OK" } ] } ], "status" : "OK" }
-
Danke für die Mühe.
Ich habe das Skript gelöscht und neu angelegt, dann ging es.
Weiß der Geier, was das war.