main->get_settings(); $settings['view_mode'] = $this->atts['location_view_mode'] ?? 'normal'; $settings['map'] = $settings['default_maps_view'] ?? 'google'; // Return the data if called by AJAX if(isset($this->atts['return_items']) and $this->atts['return_items']) { echo json_encode(array('markers' => $this->render->markers($this->events, $this->style))); exit; } $events_data = $this->render->markers($this->events, $this->style); if(count($this->events)) { // Include Map Assets such as JS and CSS libraries $this->main->load_map_assets(false, $settings); $javascript = ''; $javascript = apply_filters('mec_map_load_script', $javascript, $this, $settings); // Include javascript code into the page if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); else $this->factory->params('footer', $javascript); } do_action('mec_start_skin', $this->id); do_action('mec_map_skin_head'); ?>