Google Maps Api load only when Base Layer is switched on

61 views
Skip to first unread message

Zsolt Magyar

unread,
May 25, 2021, 7:34:19 AM5/25/21
to Heron Mapping Client Development
Dear Just,

What is the easiest way to configure, or develop the Heron.js for loading Google Maps Api script only in case when the google base layer is switched on?
I want to pay for Google, if a user switch to a Google Baselayer. The default layer is OSM. 
Originally the html file gets the Google Maps script if the page was loaded. So, the Google count one api request, even though if the user does not change the base layer to Google.
I found this in this theme. But I don't know how to integrate into Heron.
Please help me a bit, how to define a layer switch event, and load the GMaps Api only that time when a user click on the Google base layer. 
Thanks for Advance!

Zsolt Magyar
Reply all
Reply to author
Forward
0 new messages