Page 2 of 2
Re: Geocoding issue
Posted: Fri Feb 19, 2021 2:43 pm
by Thierry
bogs wrote: Fri Feb 19, 2021 2:08 pm
Well don't do that,....
Well, feeling upset with 3 smilies, you still have some chance
Sorry, I don't have a key to do a real test,
but did you try the 2 lines of script given by simon ?
This is straightforward and if this doesn't work,
then you can start thinking about the validity of your key?
Good luck,
Thierry
Re: Geocoding issue
Posted: Fri Feb 19, 2021 2:55 pm
by PaulDouBret
Yes, I remove the unnecessary lines as Thierry suggested. No change
I used the only two lines that Simon suggested. No change.
And my key works fine with launch or directly with the browser
I also tried different addresses from my short App. And tried trough the message box too with one simple line... the same that works in the browsers... no change
The point I am now.
From LC,
put doesn't work,
load doesn't work either.
Launch works OK, of course, as working directly in the browser does.
Same thing with Firefox or Safari.
My versions are updated...
Still I must do something wrong.
Is there a way I could send my testing App to somebody so you can test on your machines? ... it's 74Ko
And I never get upset. Not with LiveCode which I really like. Still I do make mistakes anyway.

Re: Geocoding issue
Posted: Fri Feb 19, 2021 2:58 pm
by PaulDouBret
Thierry,
Are you the Thierry who used to work with Hypercard??? Loooong time ago...
Re: Geocoding issue
Posted: Fri Feb 19, 2021 3:03 pm
by Thierry
PaulDouBret wrote: Fri Feb 19, 2021 2:58 pm
Are you the Thierry who used to work with Hypercard??? Loooong time ago...
Well, maybe... We are few thierry I guess

I've started using hypercard at the very beginning
and did a couple of apps in France at the end of the 80's...
Are you French ?
Thierry
Re: Geocoding issue
Posted: Fri Feb 19, 2021 3:04 pm
by elanorb
Hi
I have done a quick test here and there are a few things to try
1. Can you successfully get a value from a different URL? Could you try this test API?
Code: Select all
put "https://jsonplaceholder.typicode.com/todos/" into tURL
put url tURL
2. Try url encoding the URL e.g.
Code: Select all
put urlEncode(laddress) into laddress
replace "+" with "%20" in laddress
3. In my test (although I don't have a key) I get JSON back.
Code: Select all
put "Champ de Mars, 5 Avenue Anatole France, 75007 Paris" into laddress
put urlEncode(laddress) into laddress
replace "+" with "%20" in laddress
put url ("https://maps.googleapis.com/maps/api/geocode/json?address=" & laddress & "+France&sensor=false&key=my_Key") into loriginalrequest
put loriginalrequest into field "result"
4. You can check the result function after getting the URL. This might give you more of a clue about where the error is.
Code: Select all
put url ("https://maps123.googleapis.com/maps/api/geocode/json?address=" & laddress & "+France&sensor=false&key=my_Key") into loriginalrequest
put the result into tResult
put tResult into field "result"
Kind regards
Elanor
Re: Geocoding issue
Posted: Fri Feb 19, 2021 3:05 pm
by Thierry
Is there a way I could send my testing App to somebody so you can test on your machines?
Feel free to send it to me (zipped please)
I'll do my best
Thierry
Re: Geocoding issue
Posted: Fri Feb 19, 2021 3:53 pm
by PaulDouBret
Thansk Elanor
I will try all this over the weekend and come back to y'all on Monday
Thanks and best regards
Paul
Re: Geocoding issue ==> SIM card issue?
Posted: Mon Feb 22, 2021 10:06 am
by PaulDouBret
Good morning to y'all
With Thierry and Elanor's help, I found the reason for the geocoding calls not to work.
I am connected to internet thru a 4G router (Huawei B818) and a new SIM card (issued Dec 20). That
SIM card only has a IPv6 address and no IPv4 address. It seems to be the norm nowadays.
This restriction (and maybe others that I don't know) prevents a few things to work: the alarm system, TuneIn on a Bose speaker, etc...).
I discover this weekend that
it also prevents LC to call URLs and thus prevents geocoding!
I can surf Internet without problem with any browser but I can't call it from LC.
I installed an old SIM card... and everything works fine as it used to be.
My problem is thus not the geocoding code or the LC code but the restrictions brought by my new SIM card with a IPv6 address and no IPv4.
Of course, I welcome any idea that would allow me to call Google (or other URLSs) from LC with my new SIM card.
Thanks to all for the advices, ideas and help and best regards
Paul
Re: Geocoding issue
Posted: Mon Feb 22, 2021 7:17 pm
by liveme
Thanks for sharing this IP6 limitation to all....interesting !
sorry if I was not much of a help in this matter..
I saw you are willing to get some time measure - which is cool - here is 2 script code I use on my side to start and end a chrono task.
it returns in field "Kronotime", the final time measured in ms for a task...
you can just add the name : doStartKrono inside your button script - at the begining...and doEndKrono....at the end of the operation you want to measure.
script below to be copied on the STACK script.
Code: Select all
on doStartKrono
put the milliseconds into KronoStart
put "Chrono is ON" into field KronoTime
end doStartKrono
Code: Select all
on doEndkrono
put the milliseconds into KronoEnd
put (KronoEnd - KronoStart)&" ms" into field KronoTime
end doEndkrono
Re: Geocoding issue ==> SIM card issue?
Posted: Mon Feb 22, 2021 7:50 pm
by liveme
[quote=My problem is thus not the geocoding code or the LC code but the restrictions brought by my new SIM card with a IPv6 address and no IPv4.
[/quote]
Have you tried to see if you router offers any IPV6 to IPV4 mapping menu ?
the idea would be,
to use a feature to have the Router associate the SIM IPV6 to a virtual IPV4 set in the router before any request is sent to the internet.
it will then reverse the replies from the intenet...mapping the answers to the fixed IPV4 to the real IPV6 of your Sim card.
it should be doable on most routers... Depending on the Router ability, it could be all transparent and super fast, set once and forget it.
www youtube com/watch?v=OBxwCE2_8EQ
Re: Geocoding issue
Posted: Tue Feb 23, 2021 4:29 pm
by elanorb
Hi
I had a quick chat with the team and there is a bug report about this.
https://quality.livecode.com/show_bug.cgi?id=11674
I have added a link to this thread to the bug report.
Elanor