/** * Adds scripts needed for map coords functionality */ protected function addMapJS() { //add local map init script and google map script $this->addJs('/plugins/graker/mapmarkers/assets/js/markercoords.js'); $key = Settings::get('api_key') ? 'key=' . Settings::get('api_key') . '&' : ''; $this->addJs('https://maps.googleapis.com/maps/api/js?' . $key . 'callback=markerCoordsMapInit', ['async', 'defer']); }
/** * Adds Google Map script and local asset script to page */ protected function addGmapJs() { //local asset $this->addJs('/plugins/graker/mapmarkers/widgets/markersmap/assets/js/markersmap.js'); //Google Map $key = Settings::get('api_key') ? 'key=' . Settings::get('api_key') . '&' : ''; $this->addJs('https://maps.googleapis.com/maps/api/js?' . $key . 'callback=markersMapInit', ['async', 'defer']); }