Skip to content

Commit

Permalink
Merge pull request #767 from qld-gov-au/QOLDEV-270-services-location
Browse files Browse the repository at this point in the history
QOLDEV-270 fix location widget
  • Loading branch information
ThrawnCA authored Feb 7, 2023
2 parents 5e77d59 + c3bc206 commit 84c1c15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/assets/_project/_blocks/layout/location/qg-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ $(function () {
if (jsonResponse.hasOwnProperty('features')) {
// Add each suburb to the location list
jsonResponse['features'].forEach(function (object) {
var sourceName = object['attributes']['ADMINAREANAME'].toLowerCase();
var sourceName = object['attributes']['ADMINAREANAME'] || object['attributes']['adminareaname'];
sourceName = sourceName.toLowerCase();
var suburbLGA = titleCase(sourceName);
var suburbObject = {
'name': sourceName,
Expand Down Expand Up @@ -529,7 +530,7 @@ $(function () {
// Maps not loaded
// Create script tag
var apiKey = 'AIzaSyDvR5MCDqi0HtcjkehKqbKhyoCxt4Khqac';
var scriptURL = 'https://maps.googleapis.com/maps/api/js?key=' + apiKey;
var scriptURL = 'https://maps.googleapis.com/maps/api/js?callback=qg_location_init&key=' + apiKey;
var scriptElement = document.createElement('script');

// Populate tag
Expand All @@ -539,6 +540,8 @@ $(function () {

// Insert into the DOM
document.querySelector('body').appendChild(scriptElement);

window.qg_location_init = function() {};
scriptElement.onload = function () {
qgLocation.fn.init();
};
Expand Down

0 comments on commit 84c1c15

Please sign in to comment.