PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / trunk
Shortcodes and extra features for Phlox theme vtrunk
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / gmap.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 6 months ago accordion.php 6 months ago audio.php 6 months ago before-after.php 6 months ago button.php 6 months ago carousel-navigation.php 6 months ago circle-chart.php 6 months ago contact-box.php 6 months ago contact-form.php 6 months ago custom-list.php 6 months ago divider.php 6 months ago gallery.php 6 months ago gmap.php 2 days ago heading-modern.php 5 months ago icon.php 6 months ago image.php 6 months ago mailchimp.php 6 months ago modern-button.php 6 months ago products-grid.php 6 months ago quote.php 6 months ago recent-comments.php 6 months ago recent-posts-grid-carousel.php 1 month ago recent-posts-land-style.php 6 months ago recent-posts-masonry.php 6 months ago recent-posts-tiles-carousel.php 6 months ago recent-posts-tiles.php 6 months ago recent-posts-timeline.php 6 months ago recent-products.php 6 months ago responsive-table.php 6 months ago search.php 6 months ago staff.php 6 months ago svg.php 6 months ago tabs.php 6 months ago testimonial.php 6 months ago text.php 6 months ago touch-slider.php 6 months ago video.php 6 months ago
gmap.php
279 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Widget_Base;
5 use Elementor\Controls_Manager;
6
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 /**
13 * Elementor 'Map' widget.
14 *
15 * Elementor widget that displays an 'Map'.
16 *
17 * @since 1.0.0
18 */
19 class Gmap extends Widget_Base {
20
21 /**
22 * Get widget name.
23 *
24 * Retrieve 'Map' widget name.
25 *
26 * @since 1.0.0
27 * @access public
28 *
29 * @return string Widget name.
30 */
31 public function get_name() {
32 return 'aux_gmap';
33 }
34
35 /**
36 * Get widget title.
37 *
38 * Retrieve 'Map' widget title.
39 *
40 * @since 1.0.0
41 * @access public
42 *
43 * @return string Widget title.
44 */
45 public function get_title() {
46 return __( 'Map', 'auxin-elements' );
47 }
48
49 public function has_widget_inner_wrapper(): bool {
50 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
51 }
52
53
54 /**
55 * Get widget icon.
56 *
57 * Retrieve 'Map' widget icon.
58 *
59 * @since 1.0.0
60 * @access public
61 *
62 * @return string Widget icon.
63 */
64 public function get_icon() {
65 return 'eicon-google-maps auxin-badge';
66 }
67
68 /**
69 * Get widget categories.
70 *
71 * Retrieve 'Map' widget icon.
72 *
73 * @since 1.0.0
74 * @access public
75 *
76 * @return string Widget icon.
77 */
78 public function get_categories() {
79 return array( 'auxin-core' );
80 }
81
82 /**
83 * Register 'Map' widget controls.
84 *
85 * Adds different input fields to allow the user to change and customize the widget settings.
86 *
87 * @since 1.0.0
88 * @access protected
89 */
90 protected function register_controls() {
91
92 /*-----------------------------------------------------------------------------------*/
93 /* map_section
94 /*-----------------------------------------------------------------------------------*/
95
96 $this->start_controls_section(
97 'map_section',
98 array(
99 'label' => __('Map', 'auxin-elements' ),
100 )
101 );
102
103 $this->add_control(
104 'latitude',
105 array(
106 'label' => __('Latitude','auxin-elements' ),
107 'description' => __('Latitude location over the map.', 'auxin-elements' ),
108 'type' => Controls_Manager::TEXT,
109 'default' => '52'
110 )
111 );
112
113 $this->add_control(
114 'longitude',
115 array(
116 'label' => __('Longitude','auxin-elements' ),
117 'description' => __('Longitude location over the map.', 'auxin-elements' ),
118 'type' => Controls_Manager::TEXT,
119 'default' => '14'
120 )
121 );
122
123 $this->add_control(
124 'marker_info',
125 array(
126 'label' => __('Marker info','auxin-elements' ),
127 'description' => __('Marker popup text, leave it empty if you don\'t need it.', 'auxin-elements' ),
128 'type' => Controls_Manager::TEXT,
129 )
130 );
131
132 $this->add_control(
133 'attach_id',
134 array(
135 'label' => __('Marker Icon','auxin-elements' ),
136 'description' => __('Pick a small icon for gmaps marker.', 'auxin-elements' ),
137 'type' => Controls_Manager::MEDIA,
138 )
139 );
140
141
142 $this->end_controls_section();
143
144
145 /*-----------------------------------------------------------------------------------*/
146 /* general_section
147 /*-----------------------------------------------------------------------------------*/
148
149 $this->start_controls_section(
150 'general_section',
151 array(
152 'label' => __('General', 'auxin-elements' ),
153 'tab' => Controls_Manager::TAB_STYLE,
154 )
155 );
156
157 $this->add_control(
158 'type',
159 array(
160 'label' => __('Map type', 'auxin-elements'),
161 'type' => Controls_Manager::SELECT,
162 'default' => 'ROADMAP',
163 'options' => array(
164 'ROADMAP' => __('Roadmap', 'auxin-elements' ),
165 'Satelite' => __('Satelite' , 'auxin-elements' ),
166 )
167 )
168 );
169
170 $this->add_responsive_control(
171 'height',
172 array(
173 'label' => __('Height','auxin-elements' ),
174 'type' => Controls_Manager::NUMBER,
175 'default' => '700',
176 'selectors' => [
177 '{{WRAPPER}} .aux-map-wrapper' => 'height: {{SIZE}}px'
178 ]
179 )
180 );
181
182 $this->add_control(
183 'style',
184 array(
185 'label' => __('Map style','auxin-elements' ),
186 'description' => __('This feild allow you to customize the presentation of the standard Google base maps. You can find many preset styles in ', 'auxin-elements' ) .
187 '<a href="https://snazzymaps.com/" target="_blank">' . __('this website.', 'auxin-elements' ) . '</a>' ,
188 'type' => Controls_Manager::TEXTAREA ,
189 'condition' => array(
190 'type' => array( 'ROADMAP' ),
191 )
192 )
193 );
194
195 $this->add_control(
196 'show_mapcontrols',
197 array(
198 'label' => __('Navigation control','auxin-elements' ),
199 'description' => __('Show navigation control on map.','auxin-elements' ),
200 'type' => Controls_Manager::SWITCHER,
201 'label_on' => __( 'On', 'auxin-elements' ),
202 'label_off' => __( 'Off', 'auxin-elements' ),
203 'return_value' => 'yes',
204 'default' => 'yes'
205 )
206 );
207
208 $this->add_control(
209 'zoom',
210 array(
211 'label' => __('Zoom','auxin-elements' ),
212 'type' => Controls_Manager::TEXT,
213 'default' => '4'
214 )
215 );
216
217 $this->add_control(
218 'zoom_wheel',
219 array(
220 'label' => __('Zoom with mouse wheel','auxin-elements' ),
221 'type' => Controls_Manager::SWITCHER,
222 'label_on' => __( 'On', 'auxin-elements' ),
223 'label_off' => __( 'Off', 'auxin-elements' ),
224 'return_value' => '1',
225 'default' => '0'
226 )
227 );
228
229 $this->end_controls_section();
230 }
231
232 /**
233 * Render image box widget output on the frontend.
234 *
235 * Written in PHP and used to generate the final HTML.
236 *
237 * @since 1.0.0
238 * @access protected
239 */
240 protected function render() {
241
242 $settings = $this->get_settings_for_display();
243
244
245 $args = array(
246 'type' => $settings['type'],
247 'style' => $settings['style'],
248 'height' => $settings['height'],
249 'latitude' => $settings['latitude'],
250 'longitude' => $settings['longitude'],
251 'marker_info' => $settings['marker_info'],
252 'show_mapcontrols' => $settings['show_mapcontrols'],
253 'zoom' => $settings['zoom'],
254 'zoom_wheel' => $settings['zoom_wheel'],
255 'attach_id' => $settings['attach_id']['id'],
256 );
257
258 if( auxin_get_option( 'auxin_google_map_api_key' ) == '' ) {
259 ob_start();
260 ?>
261 <div class="elementor-alert elementor-alert-danger" role="alert">
262 <span class="elementor-alert-title">
263 <?php esc_html_e( 'Google Maps API Key Is Missing.', 'auxin-elements' ); ?>
264 </span>
265 <span class="elementor-alert-description">
266 <?php esc_html_e( 'In order to use google maps on your website, you have to create an api key and insert it in customizer "Google Maps API Key" field.', 'auxin-elements' ); ?>
267 </span>
268 </div>
269 <?php
270 echo ob_get_clean();
271 return;
272 }
273
274 // get the shortcode base blog page
275 echo auxin_widget_gmaps_callback( $args );
276 }
277
278 }
279