Google Key file now neccessary for local .html file?

Physikator's picture

When opening the wonderful local .html files, google now asks for a google maps api key. The same happens on different OS (Mac and Win), with different Browsers (Safari and Firefox) and with old and new .html files, even ones that once worked fine. Am I missing something, or has google changed its policies?

farmerkz's picture

Yes, as I understand it,

Yes, as I understand it, Google has changed the policy. This problem is not only with the html that generates bt747, but also with other programs that use the Google API. The solution is simple: you have to get the key from Google and add it to the html:
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=xxxxxxxxxxxxxx" type="text/javascript">

I manually edit my html files and they work fine.

IMHO in bt747 html converter is necessary to add an option in which user could specify the key.

mdeweerd's picture

Hi There is already a method

Hi

There is already a method to have BT747 add a key to the created file:

http://www.bt747.org/de/node/71

 

Basically you need to put a gmapkey.txt file with the key in it in the appropriate location.

Physikator's picture

Thanks for your hints. The

Thanks for your hints. The link to the google api page in http://www.bt747.org/de/node/71 leads to an outdated page. The answer of farmerkz was helpful, but somehow I first din't get it to work. I created a google account and then a key, and after fiddling around with the api version (v2, v3, or both?), it now works. Now I only need a script to add that key to some hundred files... But anyway, thanks a lot for the help!

farmerkz's picture

mdeweerd, thanks for your

mdeweerd, thanks for your hint!

Physikator's picture

I'm not sure about how this

I'm not sure about how this works. The track, which is embedded in the html-file: is it decoded in the local browser and only overlain over the map, or is it sent to google for decoding? I do not really want my tracks to be linked together by my api-key, and these data in the hands of google.

In the latter case (data is decoded by google servers): I'm willing to share my key (probably not here, to avoid problems for Mario, as google probably would not approve). Anyone interested in sharing a (or many) key(s)?

mdeweerd's picture

It is decoded locally using a

It is decoded locally using a method that was available in Google Maps V2.  The track is not sent to google (not that I know off, I launched the browser debugger and the navigator only fetches data from google).

The API key is there so that google can limit the use of the service.

Then select 'API Access' in the menu on the left.  You'll seen in the center zone 'Key for browser apps (with referers)'.

Copy the key and put it in a file called 'gmapkey.txt' - either in the location where you put your bin file or in the location where you have the BT747settings.pdb file (%USERPROFILE% on windows, your home directory on other systems).

Physikator's picture

Thanks for the good news. I

Thanks for the good news. I do have a key, and it works from sitting in the folder where the .bin file is put. I'm really glad to have the .html files back!

When I select 'API Access' in

When I select 'API Access' in the menu on the left. then I get something about "OAuth" and when I continue there, I get a "Client ID", which ist "<some number>.apps.googleusercontent.com". Is this the "Key for browser apps (with referers)"?

 

Hi, can anyone please check

Hi, can anyone please check if this description is still valid? For me, the exported html do not work, regardless if I select a Google API v2 or V3-compliant key.

In early Sept, Google

In early Sept, Google deprecated V2. For V3, a key isn't required (unless you plan to send lots of requests) - limiting seems to be done per IP. But, the mechanism is completely different. I'm not sure whether recent BT747 already contains the new query syntax...

Hi, Local coding as described

Hi, Local coding as described by mdeweerd still works but it is no longer possible to obtain v2 API keys. There is only the option to get a key for the v3 API. I guess, the HTML conversion method has finally to be migrated to use the new v3 API...

mdeweerd's picture

Hi The application has to be

Hi

The application has to be updated for Google V3.  I have already done so a long time ago in my closed C# .NET version.

As I have several customer business to attend to, I am focussing on customers first but I will update BT747 when I can.

mdeweerd's picture

BT747 was just updated for

BT747 was just updated for the Google Map (now version 3) and AGPS.

The relevant BT747 version is BT747_2.X.1981 or higher.