<?php
    namespace Pixebuilder\Element;
    
    // prevent direct file access
	if( !defined( 'ABSPATH' ) ) exit;

    class Google_Map extends Item{

        static function get_name(){
            return 'google-map';
        }

        static function get_default(){
            return array(
                'map' => array(
                    'destination' => 'Eiffel Tower'
                )
            );
        }

        static function get_title(){
            return esc_html__('Google Map', 'pixebuilder');
        }

        static function get_icon(){
            return 'map';
        }
        
        static function render_content($settings){

            $map = empty($settings['map'])? array(): $settings['map'];
            $style = empty($settings['style'])? array(): $settings['style'];
            $map = array_merge($map, $style);

            // print
            $ret  = '<div class="pixe-map" >';
            $ret .= pixe_get_map($map);
            $ret .= '</div>';

            return $ret;
        }

    }

    \Pixe_Builder::register_element('Pixebuilder\Element\Google_Map');