Skip to content

Commit

Permalink
fix: move gmaps init to php
Browse files Browse the repository at this point in the history
  • Loading branch information
gurucomkz committed Dec 20, 2021
1 parent e6fed47 commit 85e76df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/GeoLocationPickerInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ public function __construct($name, $title = null, $value = null)
{
parent::__construct($name, $title, $value);
if ($this->ApiKey()) {
Requirements::javascript(
"https://maps.googleapis.com/maps/api/js?libraries=places&key=" . urlencode($this->ApiKey()),
[
'provides' => ['googlemaps'],
'async' => true,
]
);
Requirements::javascript("gurucomkz/geopicker:javascript/geolocation-picker-input.js");
}
}
Expand Down

0 comments on commit 85e76df

Please sign in to comment.