Skip to main content

We are doing geo coding on our records by calling google api from skuid javascript snippet, we want to include api key as well in the request.


function load_map_from_address(mapid, address) { // check if gps has been locally cached. geocoder = new google.maps.Geocoder(); //alert(geocoder); var geocoderAPIKey = 'geocoderAPIKey '; geocoder.geocode({ 'address': address }, function (results, status) { //alert(status); if (status == "OK") { var gps = results[0].geometry.location; create_map(gps.lat(), gps.lng(), mapid); } else { $('#' + mapid).html('

address not found

').show(); } });
``` }

Am looking for a way to add below script tag in the javascript snippet where we are calling geocode method and also want to access api key using custom label..


    

Praveen,


In your Skuid Page Builder, add a JavaScript Resource of type ‘External’.  You can then add the URL for the Google API.



Thanks,


Bill


Thanks Bill. I have api key in custom setting, is there any way to point it there.


Praveen,

You can create a model to load your custom setting.  I am not sure if the model will load before Skuid attempts pull in the external resource.

Thanks,

Bill


Reply