PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
← All changes | elementor-elements/classes/wdk-map.php +332 -25 1.1.0 → 1.5.9 View file →
@@ -45,9 +45,11 @@
45 45 if ($this->is_edit_mode_load()) {
46 46 wp_enqueue_style('leaflet');
47 47 wp_enqueue_style('leaflet-cluster-def');
48 48 wp_enqueue_style('leaflet-cluster');
49 + wp_enqueue_style('leaflet-fullscreen');
49 50 wp_enqueue_script('leaflet');
51 + wp_enqueue_script('leaflet-fullscreen');
50 52 wp_enqueue_script('leaflet-cluster');
51 53
52 54 wp_enqueue_style('wdk-notify');
53 55 wp_enqueue_script('wdk-notify');
@@ -135,8 +137,13 @@
135 137 $columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address');
136 138 $controller = 'listing';
137 139 $custom_parameters = array();
138 140
141 + if($this->data['settings']['enable_custom_gps_center'] == 'yes') {
142 + $this->data['lat'] = $this->data['settings']['conf_custom_map_center_gps_lat'];
143 + $this->data['lng'] = $this->data['settings']['conf_custom_map_center_gps_lng'];
144 + }
145 +
139 146 if(!isset($_GET['order_by'])) {
140 147 $custom_parameters['order_by'] = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
141 148 }
142 149
@@ -160,9 +167,9 @@
160 167 $this->data['is_edit_mode']= false;
161 168 if(Plugin::$instance->editor->is_edit_mode())
162 169 $this->data['is_edit_mode']= true;
163 170
164 - echo $this->view('wdk-map', $this->data);
171 + $this->view('wdk-map', $this->data, true);
165 172
166 173 }
167 174
168 175 private function generate_controls_conf() {
@@ -173,8 +180,62 @@
173 180 'tab' => '1',
174 181 ]
175 182 );
176 183
184 + if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
185 + $this->add_control(
186 + 'is_custom_layout_enable',
187 + [
188 + 'label' => __( 'Enable Custom Layout', 'wpdirectorykit' ),
189 + 'type' => \Elementor\Controls_Manager::SWITCHER,
190 + 'label_on' => __( 'True', 'wpdirectorykit' ),
191 + 'label_off' => __( 'False', 'wpdirectorykit' ),
192 + 'return_value' => 'yes',
193 + 'default' => '',
194 +
195 + ]
196 + );
197 + $this->add_control(
198 + 'custom_layout_id',
199 + [
200 + 'label' => __( 'Layout Template id', 'wpdirectorykit' ),
201 + 'type' => \Elementor\Controls_Manager::TEXT,
202 + 'default' => '',
203 + 'placeholder' => __( 'put your template id', 'wpdirectorykit' ),
204 + 'description' => __( 'Create layout here', 'wpdirectorykit' ) . ' ' . wdk_sprintf(
205 + /* translators: 1: Tag with link open, 2: close link tag. */
206 + __('%1$s here %2$s', 'wpdirectorykit'),
207 + '<a target="_blank" href="' . esc_urL(admin_url('edit.php?post_type=elementor_library#add_new')) . '">',
208 + '</a>'
209 + ),
210 + 'conditions' => [
211 + 'terms' => [
212 + [
213 + 'name' => 'is_custom_layout_enable',
214 + 'operator' => '==',
215 + 'value' => 'yes',
216 + ]
217 + ],
218 + ],
219 + ]
220 + );
221 + }
222 +
223 + if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')){
224 + $this->add_control(
225 + 'is_ajax_enable',
226 + [
227 + 'label' => __( 'Enable Reload content with ajax', 'wpdirectorykit' ),
228 + 'type' => \Elementor\Controls_Manager::SWITCHER,
229 + 'label_on' => __( 'True', 'wpdirectorykit' ),
230 + 'label_off' => __( 'False', 'wpdirectorykit' ),
231 + 'return_value' => 'yes',
232 + 'default' => '',
233 +
234 + ]
235 + );
236 + }
237 +
177 238 /* conf_results_type :: results_listings */
178 239 if(true){
179 240 $this->add_control(
180 241 'conf_results_type_results_listings_header',
@@ -185,8 +246,61 @@
185 246 ]
186 247 );
187 248
188 249 $this->add_control(
250 + 'conf_hide_real_location',
251 + [
252 + 'label' => esc_html__( 'Hide real location', 'wpdirectorykit' ),
253 + 'type' => Controls_Manager::SWITCHER,
254 + 'none' => esc_html__( 'True', 'wpdirectorykit' ),
255 + 'block' => esc_html__( 'False', 'wpdirectorykit' ),
256 + 'render_type' => 'template',
257 + 'return_value' => 'yes',
258 + 'default' => '',
259 + ]
260 + );
261 +
262 + $this->add_control(
263 + 'enable_rectangle_auto_search',
264 + [
265 + 'label' => esc_html__( 'Recangle auto search', 'wpdirectorykit' ),
266 + 'type' => Controls_Manager::SWITCHER,
267 + 'none' => esc_html__( 'True', 'wpdirectorykit' ),
268 + 'block' => esc_html__( 'False', 'wpdirectorykit' ),
269 + 'render_type' => 'template',
270 + 'return_value' => 'yes',
271 + 'default' => 'yes',
272 + ]
273 + );
274 +
275 + $this->add_control(
276 + 'disable_rectangle',
277 + [
278 + 'label' => esc_html__( 'Disable Rectangle Search', 'wpdirectorykit' ),
279 + 'type' => Controls_Manager::SWITCHER,
280 + 'none' => esc_html__( 'True', 'wpdirectorykit' ),
281 + 'block' => esc_html__( 'False', 'wpdirectorykit' ),
282 + 'render_type' => 'template',
283 + 'return_value' => 'yes',
284 + 'default' => '',
285 + ]
286 + );
287 +
288 + $this->add_control(
289 + 'enable_scrollWheelZoom',
290 + [
291 + 'label' => esc_html__( 'Enable scrollWheelZoom', 'wpdirectorykit' ),
292 + 'type' => Controls_Manager::SWITCHER,
293 + 'none' => esc_html__( 'True', 'wpdirectorykit' ),
294 + 'block' => esc_html__( 'False', 'wpdirectorykit' ),
295 + 'render_type' => 'template',
296 + 'return_value' => 'yes',
297 + 'default' => '',
298 + 'separator' => 'after',
299 + ]
300 + );
301 +
302 + $this->add_control(
189 303 'conf_limit',
190 304 [
191 305 'label' => __( 'Limit Results', 'wpdirectorykit' ),
192 306 'type' => \Elementor\Controls_Manager::NUMBER,
@@ -204,10 +318,10 @@
204 318 'type' => \Elementor\Controls_Manager::TEXTAREA,
205 319 'rows' => 5,
206 320 'default' => '',
207 321 'placeholder' => __( 'Type your query here, example xxx', 'wpdirectorykit' ),
208 - 'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url): ', 'wpdirectorykit' ).
209 - 'field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4'.
322 + 'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url):', 'wpdirectorykit' ).
323 + ' field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4&search_agents_ids=3'.
210 324 '</span>',
211 325 ]
212 326 );
213 327
@@ -213,9 +327,9 @@
213 327
214 328 $this->add_control(
215 329 'conf_order_by',
216 330 [
217 - 'label' => __('Default Order By Column', 'wpdirectorykit'),
331 + 'label' => __('Default Sort By Column', 'wpdirectorykit'),
218 332 'type' => Controls_Manager::SELECT,
219 333 'label_block' => true,
220 334 'options' => [
221 335 'none' => __('None', 'wpdirectorykit'),
@@ -228,13 +342,15 @@
228 342
229 343 $this->add_control(
230 344 'conf_order_by_custom',
231 345 [
232 - 'label' => __('Default Custom Order By (Column)', 'wpdirectorykit'),
233 - 'description' => '<span style="word-break: break-all;">'.__( 'Example: ', 'wpdirectorykit' ).
346 + 'label' => __('Default Custom Sort By (Column)', 'wpdirectorykit'),
347 + 'description' => '<span style="word-break: break-all;">'.__( 'Example:', 'wpdirectorykit' ).
234 348 '<br> field_13_NUMBER - where 13 is field id, NUMBER - field type'.
235 349 '<br> field_4_NUMBER - where 4 is field id, NUMBER - field type'.
236 350 '<br> field_6_DROPDOWN - where 6 is field id, DROPDOWN - field type'.
351 + '<br> category_title - Category Title'.
352 + '<br> location_title - Location Title'.
237 353 '</span>',
238 354 'type' => Controls_Manager::TEXT,
239 355 'label_block' => true,
240 356 'default' => 'post_id',
@@ -304,25 +420,16 @@
304 420 ],
305 421 'render_type' => 'template',
306 422 'default' => [
307 423 'size' => 7,
308 - ],
309 - 'conditions' => [
310 - 'terms' => [
311 - [
312 - 'name' => 'conf_custom_map_auto_center',
313 - 'operator' => '!=',
314 - 'value' => 'yes',
315 - ]
316 - ],
317 424 ]
318 425 ]
319 426 );
320 427
321 - $this->add_responsive_control(
428 + $this->add_control(
322 429 'conf_custom_dragging',
323 430 [
324 - 'label' => esc_html__( 'Dragging', 'wpdirectorykit' ),
431 + 'label' => esc_html__( 'Dragging For Desktop', 'wpdirectorykit' ),
325 432 'type' => Controls_Manager::SWITCHER,
326 433 'none' => esc_html__( 'True', 'wpdirectorykit' ),
327 434 'block' => esc_html__( 'False', 'wpdirectorykit' ),
328 435 'render_type' => 'template',
@@ -330,10 +437,23 @@
330 437 'default' => 'yes',
331 438 'separator' => 'before',
332 439 ]
333 440 );
441 +
442 + $this->add_control(
443 + 'conf_custom_dragging_mobile',
444 + [
445 + 'label' => esc_html__( 'Dragging For Mobile', 'wpdirectorykit' ),
446 + 'type' => Controls_Manager::SWITCHER,
447 + 'none' => esc_html__( 'True', 'wpdirectorykit' ),
448 + 'block' => esc_html__( 'False', 'wpdirectorykit' ),
449 + 'render_type' => 'template',
450 + 'return_value' => 'yes',
451 + 'default' => '',
452 + 'separator' => 'before',
453 + ]
454 + );
334 455
335 -
336 456 $this->add_control(
337 457 'conf_custom_map_styles_h',
338 458 [
339 459 'label' => __( 'Map Styles', 'wpdirectorykit' ),
@@ -351,14 +471,30 @@
351 471 '' => esc_html__('Default', 'wpdirectorykit'),
352 472 'custom' => esc_html__('Custom', 'wpdirectorykit'),
353 473 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Light', 'wpdirectorykit'),
354 474 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' => esc_html__('Osmde', 'wpdirectorykit'),
475 + 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png' => esc_html__('Osmde Fr', 'wpdirectorykit'),
476 + 'https://tile.openstreetmap.de/{z}/{x}/{y}.png' => esc_html__('Osmde De', 'wpdirectorykit'),
477 + 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' => esc_html__('Mapnik', 'wpdirectorykit'),
355 478 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png' => esc_html__('OpenTopoMap', 'wpdirectorykit'),
356 - 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('OpenCycleMap', 'wpdirectorykit'),
357 479 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' => esc_html__('WorldImagery', 'wpdirectorykit'),
358 480 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Carto DarkMatter', 'wpdirectorykit'),
359 481 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png' => esc_html__('Carto Voyager', 'wpdirectorykit'),
360 482 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png' => esc_html__('Maptiler dark (demo)', 'wpdirectorykit'),
483 + 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png' => esc_html__('Thunderforest MobileAtlas', 'wpdirectorykit'),
484 + 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('Thunderforest OpenCycleMap', 'wpdirectorykit'),
485 + 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png' => esc_html__('Thunderforest TransportDark', 'wpdirectorykit'),
486 + 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png' => esc_html__('Thunderforest Landscape', 'wpdirectorykit'),
487 + 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png' => esc_html__('Thunderforest Outdoors', 'wpdirectorykit'),
488 + 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png' => esc_html__('Thunderforest Pioneer', 'wpdirectorykit'),
489 + 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png' => esc_html__('Thunderforest Neighbourhood', 'wpdirectorykit'),
490 + 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png' => esc_html__('CyclOSM', 'wpdirectorykit'),
491 + 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Streets', 'wpdirectorykit'),
492 + 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Sunny', 'wpdirectorykit'),
493 + 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Dark', 'wpdirectorykit'),
494 + 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Light', 'wpdirectorykit'),
495 + 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}' => esc_html__('World Top oMap', 'wpdirectorykit'),
496 + 'google_map' => esc_html__('Google Map Layout', 'wpdirectorykit'),
361 497 ],
362 498 'default' => '',
363 499 ]
364 500 );
@@ -363,8 +499,105 @@
363 499 ]
364 500 );
365 501
366 502 $this->add_control(
503 + 'jawg_map_key',
504 + [
505 + 'label' => __( 'Jawg Map API Key', 'wpdirectorykit' ),
506 + /* translators: 1: URL. */
507 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/pricing')
508 + /* translators: 1: URL. */
509 + .' '.wdk_sprintf(__( 'or check demo maps <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/maps'),
510 + 'type' => \Elementor\Controls_Manager::TEXT,
511 + 'default' => '',
512 + 'condition' => [
513 + 'conf_custom_map_style' => [
514 + 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png',
515 + 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png',
516 + 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png',
517 + 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png',
518 + ],
519 + ],
520 + ]
521 + );
522 +
523 + $this->add_control(
524 + 'carto_map_key',
525 + [
526 + 'label' => __( 'Carto Map API Key', 'wpdirectorykit' ),
527 + /* translators: 1: URL. */
528 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://carto.com/basemaps/apikey/'),
529 + 'type' => \Elementor\Controls_Manager::TEXT,
530 + 'default' => '',
531 + 'condition' => [
532 + 'conf_custom_map_style' => [
533 + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png',
534 + 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png',
535 + 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png',
536 + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png',
537 + ],
538 + ],
539 + ]
540 + );
541 +
542 + $this->add_control(
543 + 'thunderforest_map_key',
544 + [
545 + 'label' => __( 'Thunderforest Map API Key', 'wpdirectorykit' ),
546 + /* translators: 1: URL. */
547 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.thunderforest.com/pricing/'),
548 + 'type' => \Elementor\Controls_Manager::TEXT,
549 + 'default' => '',
550 + 'condition' => [
551 + 'conf_custom_map_style' => [
552 + 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png',
553 + 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png',
554 + 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png',
555 + 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png',
556 + 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png',
557 + 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png',
558 + 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png',
559 + ],
560 + ],
561 + ]
562 + );
563 +
564 + $this->add_control(
565 + 'google_map_key',
566 + [
567 + 'label' => __( 'Google Map API Key', 'wpdirectorykit' ),
568 + /* translators: 1: URL. */
569 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://developers.google.com/maps/documentation/javascript/get-api-key'),
570 + 'type' => \Elementor\Controls_Manager::TEXT,
571 + 'default' => '',
572 + 'condition' => [
573 + 'conf_custom_map_style' => ['google_map'],
574 + ],
575 + ]
576 + );
577 +
578 + $this->add_control(
579 + 'google_map_default_type',
580 + [
581 + 'label' => __( 'Default Type', 'wpdirectorykit' ),
582 + 'type' => \Elementor\Controls_Manager::SELECT,
583 + 'default' => 'roadmap',
584 + 'options' => array(
585 + 'roadmap' => __( 'Roadmap', 'wpdirectorykit' ),
586 + 'aerial' => __( 'Aerial', 'wpdirectorykit' ),
587 + 'terrain' => __( 'Terrain', 'wpdirectorykit' ),
588 + 'hybrid' => __( 'Hybrid', 'wpdirectorykit' ),
589 + 'satellite' => __( 'Satellite', 'wpdirectorykit' ),
590 + 'traffic' => __( 'Traffic', 'wpdirectorykit' ),
591 + 'transit' => __( 'Transit', 'wpdirectorykit' ),
592 + ),
593 + 'condition' => [
594 + 'conf_custom_map_style' => ['google_map'],
595 + ],
596 + ]
597 + );
598 +
599 + $this->add_control(
367 600 'conf_custom_map_style_self',
368 601 [
369 602 'label' => esc_html__('Link to custom Map Style', 'wpdirectorykit'),
370 603 'description' => esc_html__( 'You can add some custom map by link example https://leaflet-extras.github.io/leaflet-providers/preview/ or create your custom style and put link for example on maps.cloudmade.com/editor', 'wpdirectorykit' ),
@@ -412,18 +645,17 @@
412 645 );
413 646
414 647
415 648 $this->add_responsive_control(
416 - 'conf_custom_map_auto_center',
649 + 'enable_custom_gps_center',
417 650 [
418 - 'label' => esc_html__( 'Auto Centered By Listings', 'wpdirectorykit' ),
419 - 'description' => esc_html__( 'Generated center position, based on results, note: z-index and defined center positon will be ignored if exists listings', 'wpdirectorykit' ),
651 + 'label' => esc_html__( 'Enable custom GPS', 'wpdirectorykit' ),
420 652 'type' => Controls_Manager::SWITCHER,
421 653 'none' => esc_html__( 'True', 'wpdirectorykit' ),
422 654 'block' => esc_html__( 'False', 'wpdirectorykit' ),
423 655 'render_type' => 'template',
424 656 'return_value' => 'yes',
425 - 'default' => 'yes',
657 + 'default' => '',
426 658 ]
427 659 );
428 660
429 661 $this->end_controls_section();
@@ -448,8 +680,21 @@
448 680 'tab' => Controls_Manager::TAB_STYLE,
449 681 ]
450 682 );
451 683
684 + $this->add_responsive_control(
685 + 'disable_cluster',
686 + [
687 + 'label' => esc_html__( 'Disable Clusters', 'wpdirectorykit' ),
688 + 'type' => Controls_Manager::SWITCHER,
689 + 'none' => esc_html__( 'True', 'wpdirectorykit' ),
690 + 'block' => esc_html__( 'False', 'wpdirectorykit' ),
691 + 'render_type' => 'template',
692 + 'return_value' => 'yes',
693 + 'default' => '',
694 + ]
695 + );
696 +
452 697 $this->add_control(
453 698 'styles_cluster_color',
454 699 [
455 700 'label' => esc_html__('Cluster Color', 'wpdirectorykit'),
@@ -510,8 +755,43 @@
510 755 'separator' => 'before',
511 756 ]
512 757 );
513 758
759 + $fields_data = wdk_cached_field_get();
760 + $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
761 + $order_i = 0;
762 +
763 + $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
764 + $fields_list [(++$order_i).'__first_image'] = esc_html__('First Image', 'wpdirectorykit');
765 + $fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit');
766 + $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit');
767 +
768 + $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit');
769 + $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit');
770 + $fields_list [(++$order_i).'__category_title'] = esc_html__('Category', 'wpdirectorykit');
771 + $fields_list [(++$order_i).'__location_title'] = esc_html__('Location', 'wpdirectorykit');
772 +
773 + foreach($fields_data as $field)
774 + {
775 + if(wmvc_show_data('field_type', $field) == 'SECTION') {
776 + $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
777 + } else {
778 + $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
779 + }
780 + }
781 +
782 + $this->add_control(
783 + 'custom_marker_fields',
784 + [
785 + 'label' => __('Show field value instead of marker on map', 'wpdirectorykit'),
786 + 'type' => \Elementor\Controls_Manager::SELECT2,
787 + 'default' => '',
788 + 'label_block' => true,
789 + 'options' => $fields_list,
790 + 'separator' => 'after',
791 + ]
792 + );
793 +
514 794 $this->start_controls_tabs('marker_button_style');
515 795
516 796 $this->start_controls_tab(
517 797 'marker',
@@ -526,8 +806,9 @@
526 806 'label' => esc_html__('Marker Border Color', 'wpdirectorykit'),
527 807 'type' => Controls_Manager::COLOR,
528 808 'selectors' => [
529 809 '{{WRAPPER}} .wdk-element .wdk-map .wdk_marker-card::before' => 'background-color: {{VALUE}};',
810 + '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label' => 'border-color: {{VALUE}};',
530 811 ],
531 812 ]
532 813 );
533 814
@@ -537,8 +818,9 @@
537 818 'label' => esc_html__('Marker Color', 'wpdirectorykit'),
538 819 'type' => Controls_Manager::COLOR,
539 820 'selectors' => [
540 821 '{{WRAPPER}} .wdk-element .wdk_marker-card:after' => 'background-color: {{VALUE}};',
822 + '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label' => 'background-color: {{VALUE}};',
541 823 ],
542 824 ]
543 825 );
544 826
@@ -548,8 +830,9 @@
548 830 'label' => esc_html__('Marker Text Color', 'wpdirectorykit'),
549 831 'type' => Controls_Manager::COLOR,
550 832 'selectors' => [
551 833 '{{WRAPPER}} .wdk_face i' => 'color: {{VALUE}};',
834 + '{{WRAPPER}} .wdk_marker-container.wdk_marker_label' => 'color: {{VALUE}};',
552 835 ],
553 836 ]
554 837 );
555 838
@@ -590,8 +873,9 @@
590 873 'label' => esc_html__('Marker Border Color', 'wpdirectorykit'),
591 874 'type' => Controls_Manager::COLOR,
592 875 'selectors' => [
593 876 '{{WRAPPER}} .wdk-element .wdk_marker-container:hover .wdk_marker-card:before' => 'background-color: {{VALUE}};',
877 + '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label:hover' => 'border-color: {{VALUE}};',
594 878 ],
595 879 ]
596 880 );
597 881
@@ -601,8 +885,9 @@
601 885 'label' => esc_html__('Marker Color', 'wpdirectorykit'),
602 886 'type' => Controls_Manager::COLOR,
603 887 'selectors' => [
604 888 '{{WRAPPER}} .wdk-element .wdk_marker-container:hover .wdk_marker-card:after' => 'background-color: {{VALUE}};',
889 + '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label:hover' => 'background-color: {{VALUE}};',
605 890 ],
606 891 ]
607 892 );
608 893
@@ -612,8 +897,9 @@
612 897 'label' => esc_html__('Marker Text Color', 'wpdirectorykit'),
613 898 'type' => Controls_Manager::COLOR,
614 899 'selectors' => [
615 900 '{{WRAPPER}} .wdk_marker-container:hover .wdk_face.back i, .wdk_marker-container:hover .wdk_face i' => 'color: {{VALUE}};',
901 + '{{WRAPPER}} .wdk_marker-container.wdk_marker_label:hover' => 'color: {{VALUE}};',
616 902 ],
617 903 ]
618 904 );
619 905
@@ -630,8 +916,9 @@
630 916 ],
631 917 ],
632 918 'selectors' => [
633 919 '{{WRAPPER}} .wdk_map-marker-container.clicked .wdk_face.front, .wdk_marker-container:hover .wdk_face.front' => 'transition-duration: {{SIZE}}ms',
920 + '{{WRAPPER}} .wdk_marker-container.wdk_marker_label' => 'transition-duration: {{SIZE}}ms',
634 921 ],
635 922 ]
636 923 );
637 924
@@ -638,8 +925,12 @@
638 925 $this->end_controls_tab();
639 926
640 927 $this->end_controls_tabs();
641 928 $this->end_controls_section();
929 +
930 +
931 +
932 +
642 933 }
643 934
644 935 private function generate_controls_content() {
645 936 /* default marker layout */
@@ -661,9 +952,9 @@
661 952
662 953 $this->add_responsive_control(
663 954 'styles_thmbn_des_type',
664 955 [
665 - 'label' => __( 'Design type ', 'wpdirectorykit' ),
956 + 'label' => __( 'Design type', 'wpdirectorykit' ),
666 957 'type' => \Elementor\Controls_Manager::SELECT,
667 958 'default' => 'wdk_size_image_cover',
668 959 'options' => [
669 960 '' => __( 'Default Sizes', 'wpdirectorykit' ),
@@ -1066,11 +1357,27 @@
1066 1357 wp_enqueue_style('leaflet-cluster-def');
1067 1358 wp_enqueue_style('leaflet-cluster');
1068 1359 wp_enqueue_script('leaflet');
1069 1360 wp_enqueue_script('leaflet-cluster');
1070 -
1361 + wp_enqueue_script('leaflet-fullscreen');
1362 + wp_enqueue_style('leaflet-fullscreen');
1363 +
1071 1364 wp_enqueue_style('wdk-notify');
1072 1365 wp_enqueue_script('wdk-notify');
1073 1366 wp_enqueue_style( 'wdk-listings-map' );
1367 +
1368 +
1369 + wp_enqueue_style('slick');
1370 + wp_enqueue_style('slick-theme');
1371 + wp_enqueue_style('wdk-hover');
1372 + wp_enqueue_script('slick');
1373 + wp_enqueue_script('leaflet-googlemutant');
1374 +
1375 + wp_enqueue_style('leaflet-draw');
1376 + wp_enqueue_script('wdk-map-rectangle');
1377 +
1378 + if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')) {
1379 + wp_enqueue_script( 'wdk-ajax-loading-listings');
1380 + }
1074 1381 }
1075 1382
1076 1383 }