<?php
add_action( 'vc_before_init', 'dt_sc_google_map_vc_map' );
function dt_sc_google_map_vc_map() {

	vc_map( array(
		"name" => esc_html__( "Google Map", 'dental-core' ),
		"base" => "dt_sc_google_map",
		"category" => DT_VC_CATEGORY,
		"class" => "dt_vc_style",
		"icon" => "dt_sc_google_map",
		'as_parent' => array( 'only' => 'dt_sc_google_map_marker' ),
		"content_element" => true,
		"params" => array(

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Map Type', 'dental-core' ),
      			'param_name' => 'map_type',
      			'value' => array(
      				esc_html__('Roadmap','dental-core') => 'roadmap',
      				esc_html__('Satellite','dental-core') => 'satellite',
      				esc_html__('Terrain','dental-core') => 'terrain',
      				esc_html__('Hybrid','dental-core') => 'hybrid'
      			),
				'save_always' => true,
      			'description' => esc_html__( 'The popup window which appears when a marker is clicked.', 'dental-core' ),				
			),

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Map Style', 'dental-core' ),
      			'param_name' => 'map_style',
      			'value' => array(
      				esc_html__('Default','dental-core') => '',
      				esc_html__('Custom','dental-core') => 'custom',
					esc_html__('Style 1','dental-core') => '1',
					esc_html__('Style 2','dental-core') => '2',
					esc_html__('Style 3','dental-core') => '3',
					esc_html__('Style 4','dental-core') => '4',
					esc_html__('Style 5','dental-core') => '5',
					esc_html__('Style 6','dental-core') => '6',
					esc_html__('Style 7','dental-core') => '7',
					esc_html__('Style 8','dental-core') => '8',
					esc_html__('Style 9','dental-core') => '9',
					esc_html__('Style 10','dental-core') => '10',
					esc_html__('Style 11','dental-core') => '11',
					esc_html__('Style 12','dental-core') => '12',
					esc_html__('Style 13','dental-core') => '13',
					esc_html__('Style 14','dental-core') => '14',
					esc_html__('Style 15','dental-core') => '15',
					esc_html__('Style 16','dental-core') => '16',
					esc_html__('Style 17','dental-core') => '17',
					esc_html__('Style 18','dental-core') => '18',
					esc_html__('Style 19','dental-core') => '19',
					esc_html__('Style 20','dental-core') => '20',
					esc_html__('Style 21','dental-core') => '21',
					esc_html__('Style 22','dental-core') => '22',
					esc_html__('Style 23','dental-core') => '23',
					esc_html__('Style 24','dental-core') => '24',
					esc_html__('Style 25','dental-core') => '25',
					esc_html__('Style 26','dental-core') => '26',
					esc_html__('Style 27','dental-core') => '27',
					esc_html__('Style 28','dental-core') => '28',
					esc_html__('Style 29','dental-core') => '29',
					esc_html__('Style 30','dental-core') => '30',
					esc_html__('Style 31','dental-core') => '31',
					esc_html__('Style 32','dental-core') => '32',
					esc_html__('Style 33','dental-core') => '33',
					esc_html__('Style 34','dental-core') => '34',
					esc_html__('Style 35','dental-core') => '35',
					esc_html__('Style 36','dental-core') => '36',
					esc_html__('Style 37','dental-core') => '37',
					esc_html__('Style 38','dental-core') => '38',
					esc_html__('Style 39','dental-core') => '39',
					esc_html__('Style 40','dental-core') => '40',
					esc_html__('Style 41','dental-core') => '41',
					esc_html__('Style 42','dental-core') => '42',
					esc_html__('Style 43','dental-core') => '43',
					esc_html__('Style 44','dental-core') => '44',
					esc_html__('Style 45','dental-core') => '45',
					esc_html__('Style 46','dental-core') => '46',
					esc_html__('Style 47','dental-core') => '47',
					esc_html__('Style 48','dental-core') => '48',
					esc_html__('Style 49','dental-core') => '49',
					esc_html__('Style 50','dental-core') => '50',      				
      			),
      			'description' => esc_html__( 'Choose map custom style.', 'dental-core' ),				
			),

			array(
				"type" => "colorpicker",
      			"heading" => esc_html__( "Custom Style", 'dental-core' ),
      			"param_name" => "custom_map_style",
      			"description" => esc_html__( "Select custom color for map", 'dental-core' ),
				'dependency' => array( 'element' => 'map_style', 'value' =>'custom' )				
			),

			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Map Width', 'dental-core' ),
				'param_name' => 'map_width',
				'save_always' => true,
				'edit_field_class' => 'vc_col-sm-6',
				'value' => '100%',
      			'description' => esc_html__( 'In px or % , 100% for a responsive map.', 'dental-core' ),
			),

			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Map Height', 'dental-core' ),
				'param_name' => 'map_height',
				'save_always' => true,
				'edit_field_class' => 'vc_col-sm-6',
				'value' => '500px',
      			'description' => esc_html__( 'In px or % ,eg: 500px or 30%.', 'dental-core' ),
			),

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Map Zoom Level', 'dental-core' ),
      			'param_name' => 'map_zoom_level',
      			'value' => array( 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20),
				'save_always' => true,
				'std' => 12
			),			

			// Controls
			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Street View Control', 'dental-core' ),
      			'param_name' => 'map_street_view_control',
				'edit_field_class' => 'vc_col-sm-6',
      			'value' => array(
      				esc_html__('Enable','dental-core') => 'enable',
      				esc_html__('Disable','dental-core') => 'disable'
      			),
				'save_always' => true,
			),

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Map Type Control', 'dental-core' ),
      			'param_name' => 'map_type_control',
				'edit_field_class' => 'vc_col-sm-6',
      			'value' => array(
      				esc_html__('Enable','dental-core') => 'enable',
      				esc_html__('Disable','dental-core') => 'disable'
      			),
				'save_always' => true,
			),

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Zoom Control', 'dental-core' ),
      			'param_name' => 'map_zoom_control',
				'edit_field_class' => 'vc_col-sm-6',
      			'value' => array(
      				esc_html__('Enable','dental-core') => 'enable',
      				esc_html__('Disable','dental-core') => 'disable'
      			),
				'save_always' => true,
			),

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Scale Control', 'dental-core' ),
      			'param_name' => 'map_scale_control',
				'edit_field_class' => 'vc_col-sm-6',
      			'value' => array(
      				esc_html__('Enable','dental-core') => 'enable',
      				esc_html__('Disable','dental-core') => 'disable'
      			),
				'save_always' => true,
			),

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Scroll wheel', 'dental-core' ),
      			'param_name' => 'map_scroll_wheel',
				'edit_field_class' => 'vc_col-sm-6',
      			'value' => array(
      				esc_html__('Enable','dental-core') => 'enable',
      				esc_html__('Disable','dental-core') => 'disable'
      			),
				'save_always' => true,
			),

			array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( ' Draggable?', 'dental-core' ),
      			'param_name' => 'map_draggable',
				'edit_field_class' => 'vc_col-sm-6',
      			'value' => array(
      				esc_html__('Enable','dental-core') => 'enable',
      				esc_html__('Disable','dental-core') => 'disable'
      			),
				'save_always' => true,
			),

			vc_map_add_css_animation(),

			array(
				"type" => "textfield",
				"heading" => __("Animation delay ( optional )", 'dental-core'),
				"edit_field_class" => 'vc_col-sm-6 vc_column',
				"param_name" => "delay",
				"value" => "0",
				"description" => __("Set the animation delay ( e.g 200 )", 'dental-core')
			),			
			// Controls
			
			// Markers
			array(
				'type' => 'param_group',
				'param_name' => 'map_markers',
				'group' => esc_html__( 'Markers', 'dental-core' ),
				'params' => array(

					array(
						'type' => 'textfield',
						'heading' => esc_html__( 'Latitude', 'dental-core' ),
						'param_name' => 'marker_latitude',
						'save_always' => true
					),

					array(
						'type' => 'textfield',
						'heading' => esc_html__( 'Longitude', 'dental-core' ),
						'param_name' => 'marker_longitude',
						'save_always' => true
					),

					array(
						'type' => 'textarea_raw_html',
						'heading' => esc_html__('Content', 'dental-core'),
						'param_name' => 'marker_content',
					),

					array(
		      			'type' => 'dropdown',
		      			'heading' => esc_html__( 'Icon', 'dental-core' ),
		      			'param_name' => 'marker_icon',
						'save_always' => true,
		      			'value' => array( 
		      				esc_html__('Built in','dental-core') => 'pin.png',
		      				esc_html__('Custom','dental-core') => 'custom',
		      				esc_html__('Black','dental-core') => 'black.png',
		      				esc_html__('Blue','dental-core') => 'blue.png',
		      				esc_html__('Gray','dental-core') => 'gray.png',
		      				esc_html__('Green','dental-core') => 'green.png',
		      				esc_html__('Magenta','dental-core') => 'magenta.png',
		      				esc_html__('Orange','dental-core') => 'orange.png',
		      				esc_html__('Purple','dental-core') => 'purple.png',
		      				esc_html__('Red','dental-core') => 'red.png',
		      				esc_html__('White','dental-core') => 'white.png',
		      				esc_html__('Yellow','dental-core') => 'yellow.png',
		      			),
		      			'description' => esc_html__( 'Select marker icon', 'dental-core' ),
		      			'std' => 'green.png',
					),

					array(
						"type" => "attach_image",
		      			"heading" => esc_html__( "Custom Marker icon", 'dental-core' ),
		      			"param_name" => "custom_marker_icon",
		      			"group" => esc_html__( 'Marker', 'dental-core' ),
		      			"description" => esc_html__( "Select custom marker icon", 'dental-core' ),
						'dependency' => array( 'element' => 'marker_icon', 'value' =>'custom' )				
					),

					array(
		      			'type' => 'dropdown',
		      			'heading' => esc_html__( 'Popup Window', 'dental-core' ),
		      			'group' => esc_html__( 'Marker', 'dental-core' ),
		      			'param_name' => 'popup',
		      			'value' => array(
		      				esc_html__('Hidden','dental-core') => 'hidden',
		      				esc_html__('Visible','dental-core') => 'visible'
		      			),
						'save_always' => true,
		      			'description' => esc_html__( 'The popup window which appears when a marker is clicked.', 'dental-core' ),
					),
				)
			)
			// markers
		)
	) );
}
