3
votes

I have a doGet() GAS where I call a HTML file with the HtmlService.
In the HTML file I have the basic Google Maps API call

<script src="http://maps.googleapis.com/maps/api/js?v=3.11?key=kkkkkkeeeeeyyyy&sensor=true" type="text/javascript">
</script>

On the <body> I show a simple dynamic map with a marker with
the onload="initialize()" function. I enabled the API on my
project and I also edited the allowed referees.

When I open the page this shows an error indicating
Properties cannot end in "__": Rule "setBadSuffix"

When checking out the caja documentation I understand that
Google Maps API can be called as from r5160, is this right?

But the error coincides with the HtmlService documentation
refering to this double underscore not being allowed.

So is it realy not possible to load the google map API in the
HtmlService and if not would it be wurth a request in Apps
Script issues
or better in Caja issues?

1
I was under the impression that it was impossible, but I may be wrong. I think it would great if Google whitelisted its own JS APIs in GAS like jQuery. - Fred
I am not sure if it is possible, but as I read the documentation and saw that jQuery can be used I was expecting the regular Google Apis to work as well. - Jacobvdb
@KevinReid should I remove my question than? It is a bid diferent because of the htmlservice which I am using... - Jacobvdb
An alternative approach is to host your web page(s) separately and communicate with the GAS as a service using content service to return data. An example using jQuery here davethinkingaloud.blogspot.co.nz/2013/03/… - DavidF

1 Answers

0
votes

You could use the GAS API for Maps Services.

You would not have to include the external script and you may also avoid some of the Quota Limits (when you did indeed figure out a work around ie an HTTP call).

Check it out: https://developers.google.com/apps-script/reference/maps/

Jacob