3

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?

Jacobvdb
  • 1,438
  • 1
  • 14
  • 28
  • 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 Apr 17 '13 at 13:20
  • 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 Apr 17 '13 at 14:37
  • possible duplicate of [Use the full Google Maps V3 API and all its features in Google Apps Script](http://stackoverflow.com/questions/11820188/use-the-full-google-maps-v3-api-and-all-its-features-in-google-apps-script) – Kevin Reid Apr 17 '13 at 16:55
  • @KevinReid should I remove my question than? It is a bid diferent because of the htmlservice which I am using... – Jacobvdb Apr 17 '13 at 17:42
  • 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 http://davethinkingaloud.blogspot.co.nz/2013/03/jsonp-and-google-apps-script.html – DavidF Apr 17 '13 at 18:49
  • @Jacobvdb The other question is also about using HtmlService. Don't remove your question — even if it is closed as duplicate then it still remains helpful for future searchers to find the question. – Kevin Reid Apr 17 '13 at 21:49

1 Answers1

0

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

Jacob Flatter
  • 171
  • 2
  • 11
  • That is true but it only allows static maps.. With hardly any interaction missing all the cool stuff of the MAPS API v3. – Jacobvdb Nov 30 '13 at 18:42