GoogleMap Control


#1

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?


#2

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.


#3

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


#4

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.


#5

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

Robb


#6

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


#7

What are the complete contents of your extraheaders?


#8

<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


#9

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.


#10
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.


#11

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

It should be in the next build.


#12

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


Where do you enter the Google Map API Key?
#13

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

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


#14

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