NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: debraballenger on October 23, 2013, 04:02:44 PM
-
In my app I need to calculate the shortest driving distance between 2 addresses. I have a custom script that I am including in the webserver procdure. And I use a function from that procedure behind a button to get the distance, display it and write it to the database.
However when I include the google maps API I am getting the following error. The Google maps api server rejected your request. The sensor parameter specified in the request must be set to either true or false.
I can use this code in an html page and I do not get this error, so I think there is something incompatible, but I am not sure what. I have included an example app.
Does anyone have suggestions for what I need to do differently?
My environment is C8 9759 and NT 7.25
Thanks,
Debra
[attachment deleted by admin]
-
Hi Debra,
I haven't done this nor did I look at your app, so FWIT:
When including the Google API it needs to be more than just a normal script definition, it needs to pass a parameter:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
Check your HTML <head> section to see if you have the correct definition.
Regards
Bill
-
I probably should have mentioned that in my post :) But yes I have that with the sensor=false in the webserver scripts section. And it appears in the source of my page. So thats why I am stumped. Although it does have an extra ?c at the end that I did not put there... so its odd.
-
if it looks like
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true?c"></script>
Then it won't work.
Its the AutoCheckCache option, you'll need to turn it off.
Its an extension off your main window, on the advanced tab.
-
Thanks Bill, that helped. I also had to change the ? to an & before the sensor. So my script tag looks like this
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" type="text/javascript"></script>
By turning off the Auto Check Cache, am I hurting anything? Do I need to do something extra in my code to account for this?
Thanks again!
Debra
-
Hi Debra,
see
http://www.capesoft.com/docs/NetTalk7/NetTalkWebFunctionality.htm#WebserverAdvanced
I will look to see if we can keep that setting on for hand-coded scripts though in an upcoming build.
Cheers
Bruce
-
For 7.28 I've added a setting so you can suppress the cache-check specifically on the javascript file that takes parameters.
Better yet, it's a bit smarter now about recognizing there are already parameters, and hence formatting the parameter a bit better. So it might work better even with it on.
-
Cool