GoogleMap Control

How can I add the API key? I tried the demo, same issue I tried adding a src line in the extra headers property didn’t seem to work. Ideas?

From what I recall I think Google Maps can be used without an API key if the parameter v=3 is passed. Additionally, try running your app from a server and see how that works.

Just an additional - AppStudio’s googlemap widget doesn’t need an API key since it is calling the version 3 API for Google Maps.

It should work. According to Google’s documentation:

https://developers.google.com/maps/documentation/javascript/get-api-key

you should put a line like this into extraheaders:

<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"></script>

George Henne
NS BASIC Corporation
http://www.nsbasic.com

Adding the the line into the extraheaders generates another error, stating multiple references to the API will cause errors. This has been tried and doesn’t work properly.

The widget is causing this error, I am running the sample included with AppStudio.

Robb

Running the v3 sample raised the same error… I think the days of no apikey are past…

What are the complete contents of your extraheaders?

<script async defer src="https://maps.googleapis.com/maps/api/js?key=MY KEY" type="text/javascript"></script>

I was able to clear all warnings using this extraheader with the v3 demo.

The GoogleMap Widget demo has the v=3 parameter embedded and conflicts with the extraheaders apikey line.

Robb

The message is probably accurate. There should be another script tag somewhere defining this again. Do a right click View Source in the browser and have a look.

Yes, I found the generated code, not sure how to prevent it from being generated ...

{HeaderBar1.onclick(HeaderBar1_right.getAttribute(‘nsbvalue’))}};
if (navigator.onLine != false) {
var script = document.createElement(‘script’);
script.src = ‘https://maps.googleapis.com/maps/api/js?v=3.exp&callback=GoogleMap1.refresh’;
document.head.appendChild(script, script.src);
}

It doesn’t seem that I can edit the GoogleMap.js module in the toolbox folder.

I think we need to add an API Key property to the control.

It should be in the next build.

1 Like

OK, added to next build. Should be out in the next few days.

1 Like

@rkantor check this out Where do you enter the Google Map API Key? - AppStudio

It may be helpful to what you need to get done.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.