cloudy cloudy

Author Topic: google maps API key  (Read 1097 times)

0 Members and 1 Guest are viewing this topic.

Offline tobydude

  • Posts: 209
  • Norway
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 70.0.3538.102
    • Fjærvoll Værstasjon
google maps API key
« on: January 24, 2019, 08:22:34 AM »
Hi.
For the suncalc in Leuven template, where should I put the google map API key?
In which file should the key go?

thanks.

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,346
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: google maps API key
« Reply #1 on: January 24, 2019, 09:04:41 AM »
Hi.
For the suncalc in Leuven template, where should I put the google map API key?
In which file should the key go?
thanks.

There is nothing you can do.  Those scripts do not run on your website, you can not change / enhance them at all.
They run in an iFrame, in your case similar to this http://suncalc.net/#/68.6465,14.4378,8/2019.01.24/09:58
The developer of  suncalc is working on it, see the pop-up which shows in that link
Quote
Note (Oct 2018): I'm aware of the broken map (see this article for more context). Stay tuned — I'm working on a new version!

Last year June, the script was deleted from the template-downloads because of the Google changes.

Wim
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline tobydude

  • Posts: 209
  • Norway
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 70.0.3538.102
    • Fjærvoll Værstasjon
Re: google maps API key
« Reply #2 on: January 24, 2019, 06:12:51 PM »
Hi. Thanks for answering.
I have mailed the scripts autor to help. :)

The suncalc at vindpropell.no, now:  http://vindpropell.no/weather2/index.php?p=06&lang=no

« Last Edit: January 24, 2019, 06:29:01 PM by tobydude »

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,346
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: google maps API key
« Reply #3 on: January 24, 2019, 06:28:38 PM »
Hi. Thanks for answering.
The script runs at my website, but I can not put in the right Google maps API key.
I have got the right key, but dont know whwre to put it. .)

Tis is the script with the old key, but how to access?  https://maps.googleapis.com/maps/api/js?key=AIzaSyCZX07EcLk3WSSkq6JdIN2c1H5a_lW83V0

The suncalc at vindpropell.no, now:  http://vindpropell.no/weather2/index.php?p=06&lang=no

Your page http://vindpropell.no/weather2/index.php?p=06&lang=no

loads in an iFrame    http://suncalc.net/    that is another ones website not yours.

The API key should be inserted in that script in the suncalc website, only the author of suncalc can do that.

Wim
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline tobydude

  • Posts: 209
  • Norway
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 70.0.3538.102
    • Fjærvoll Værstasjon
Re: google maps API key
« Reply #4 on: January 24, 2019, 06:30:43 PM »
Ok. I understand. Have written the author.
wi´ll see. Thanks.

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,346
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: google maps API key
« Reply #5 on: January 24, 2019, 06:56:38 PM »
Ok. I understand. Have written the author.
wi´ll see. Thanks.
What you could do in the meantime
1. Copy the full page html of http://suncalc.net/ 
2. Change the links to the javascripts and css to the full URL (by adding http://suncalc.net/)
3. Insert your own API key in the link to google maps at line 17
4. Put the html on your website, example testsc.html
5. Run it with  http://vindpropell.no/testsc.html
6. change the link in weather2/inc/suncalc_frame.php line 38 from
Code: [Select]
$url            = 'http://suncalc.net'.$extra;to
Code: [Select]
$url            = 'http://vindpropell.no/testsc.html';
I tested it, and it seems to work with a valid API-key for the site it is running from, in your case the key must be valid for vindpropell.no
Attached the version which works.

Wim
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline tobydude

  • Posts: 209
  • Norway
  • OS/Browser:
  • Android 8.0.0
  • Chrome 71.0.3578.99
    • Fjærvoll Værstasjon
Re: google maps API key
« Reply #6 on: January 25, 2019, 12:08:06 PM »
Thanks. Got it to work now. Importen to use right wildcard in the making of the  URL.
« Last Edit: January 25, 2019, 12:12:54 PM by tobydude »

 

cumulus