Correct bug in the Google Maps key inclusion

This commit is contained in:
Eric Schultz 2018-07-17 17:05:00 -05:00
parent 1a779f48d4
commit 6da496b736
2 changed files with 4 additions and 4 deletions

View file

@ -16,9 +16,9 @@
script.id = 'google_maps' script.id = 'google_maps'
let key = "" let key = ""
if (app.map_provider_options && app.map_provider_options.key) { if (app.map_provider_options && app.map_provider_options.key) {
key = `api_key=${app.map_provider_options.key}&` key = `key=${app.map_provider_options.key}&`
} }
script.src = `https://maps.googleapis.com/maps/api/js?${key}v=3.exp&sensor=false&libraries=places` script.src = `https://maps.googleapis.com/maps/api/js?${key}v=3.exp&libraries=places`
document.body.appendChild(script) document.body.appendChild(script)
</script> </script>
<% npo_full_address = Format::Address.full_address(@nonprofit.address, @nonprofit.city, @nonprofit.state_code, @nonprofit.zip_code) %> <% npo_full_address = Format::Address.full_address(@nonprofit.address, @nonprofit.city, @nonprofit.state_code, @nonprofit.zip_code) %>

View file

@ -21,9 +21,9 @@ cc_map.init = function(endpoint, options_obj, query) {
script.id = 'google_maps' script.id = 'google_maps'
let key = "" let key = ""
if (app.map_provider_options && app.map_provider_options.key) { if (app.map_provider_options && app.map_provider_options.key) {
key = `api_key=${app.map_provider_options.key}&` key = `key=${app.map_provider_options.key}&`
} }
script.src = `https://maps.googleapis.com/maps/api/js?${key}sensor=false&callback=draw_map` script.src = `https://maps.googleapis.com/maps/api/js?${key}callback=draw_map`
document.body.appendChild(script) document.body.appendChild(script)
set_extra_options(options_obj) set_extra_options(options_obj)
} else { } else {