im using octobercms version 3 latest version
im trying to create a google map on formwidget
public function loadAssets()
{
$this->addJs( xxxx );
}
- if im using loadAsset and $this->addJS its only called once if loaded
example menu “map” → create new map
the page loaded fine, my google map showed up
if i try to update the record or create new map, the google map not showed up cause its only loaded the JS once
==============================================
2. so, i try to put js script in my widget partial.htm
if i refresh my form page its show the google map
but if im back to menu “map” then try to create new again
the page blinking then loaded / refreshed twice ,
my google map script called twice and its showing error
“You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.”
is there a solution for my problem ?
i need the JS to be called once everytime i open the form page either for create / update