| @@ -170,9 +170,9 @@ | ||
| 170 | 170 | if(Plugin::$instance->editor->is_edit_mode() || empty($wdk_listing_id)) { |
| 171 | 171 | $this->data['is_edit_mode']= true; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - echo $this->view('wdk-listing-map', $this->data); | |
| 174 | + $this->view('wdk-listing-map', $this->data, true); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | private function generate_controls_conf() { |
| 178 | 178 | if(true){ |
| @@ -236,11 +236,9 @@ | ||
| 236 | 236 | ], |
| 237 | 237 | ] |
| 238 | 238 | ); |
| 239 | 239 | |
| 240 | - $WMVC = &wdk_get_instance(); | |
| 241 | - $WMVC->model('field_m'); | |
| 242 | - $fields_data = $WMVC->field_m->get(); | |
| 240 | + $fields_data = wdk_cached_field_get(); | |
| 243 | 241 | $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); |
| 244 | 242 | $order_i = 0; |
| 245 | 243 | |
| 246 | 244 | $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit'); |
| @@ -268,9 +266,9 @@ | ||
| 268 | 266 | $this->add_control( |
| 269 | 267 | 'field_id', |
| 270 | 268 | [ |
| 271 | 269 | 'label' => __( 'Marker position based on field with address (Detected gps by api)', 'wpdirectorykit' ), |
| 272 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 270 | + 'type' => \Elementor\Controls_Manager::SELECT2, | |
| 273 | 271 | 'default' => '', |
| 274 | 272 | 'options' => $fields_list, |
| 275 | 273 | 'separator' => 'after', |
| 276 | 274 | ] |
| @@ -367,9 +365,8 @@ | ||
| 367 | 365 | ] |
| 368 | 366 | ] |
| 369 | 367 | ); |
| 370 | 368 | |
| 371 | - | |
| 372 | 369 | $this->add_control( |
| 373 | 370 | 'conf_custom_map_styles_h', |
| 374 | 371 | [ |
| 375 | 372 | 'label' => __( 'Map Styles', 'wpdirectorykit' ), |
| @@ -387,20 +384,133 @@ | ||
| 387 | 384 | '' => esc_html__('Default', 'wpdirectorykit'), |
| 388 | 385 | 'custom' => esc_html__('Custom', 'wpdirectorykit'), |
| 389 | 386 | 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Light', 'wpdirectorykit'), |
| 390 | 387 | 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' => esc_html__('Osmde', 'wpdirectorykit'), |
| 388 | + 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png' => esc_html__('Osmde Fr', 'wpdirectorykit'), | |
| 389 | + 'https://tile.openstreetmap.de/{z}/{x}/{y}.png' => esc_html__('Osmde De', 'wpdirectorykit'), | |
| 390 | + 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' => esc_html__('Mapnik', 'wpdirectorykit'), | |
| 391 | 391 | 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png' => esc_html__('OpenTopoMap', 'wpdirectorykit'), |
| 392 | - 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('OpenCycleMap', 'wpdirectorykit'), | |
| 393 | 392 | 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' => esc_html__('WorldImagery', 'wpdirectorykit'), |
| 394 | 393 | 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Carto DarkMatter', 'wpdirectorykit'), |
| 395 | 394 | 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png' => esc_html__('Carto Voyager', 'wpdirectorykit'), |
| 396 | 395 | 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png' => esc_html__('Maptiler dark (demo)', 'wpdirectorykit'), |
| 396 | + 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png' => esc_html__('Thunderforest MobileAtlas', 'wpdirectorykit'), | |
| 397 | + 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('Thunderforest OpenCycleMap', 'wpdirectorykit'), | |
| 398 | + 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png' => esc_html__('Thunderforest TransportDark', 'wpdirectorykit'), | |
| 399 | + 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png' => esc_html__('Thunderforest Landscape', 'wpdirectorykit'), | |
| 400 | + 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png' => esc_html__('Thunderforest Outdoors', 'wpdirectorykit'), | |
| 401 | + 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png' => esc_html__('Thunderforest Pioneer', 'wpdirectorykit'), | |
| 402 | + 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png' => esc_html__('Thunderforest Neighbourhood', 'wpdirectorykit'), | |
| 403 | + 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png' => esc_html__('CyclOSM', 'wpdirectorykit'), | |
| 404 | + 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Streets', 'wpdirectorykit'), | |
| 405 | + 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Sunny', 'wpdirectorykit'), | |
| 406 | + 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Dark', 'wpdirectorykit'), | |
| 407 | + 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Light', 'wpdirectorykit'), | |
| 408 | + 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}' => esc_html__('World Top oMap', 'wpdirectorykit'), | |
| 409 | + 'google_map' => esc_html__('Google Map Layout', 'wpdirectorykit'), | |
| 397 | 410 | ], |
| 398 | 411 | 'default' => '', |
| 399 | 412 | ] |
| 400 | 413 | ); |
| 414 | + | |
| 415 | + $this->add_control( | |
| 416 | + 'jawg_map_key', | |
| 417 | + [ | |
| 418 | + 'label' => __( 'Jawg Map API Key', 'wpdirectorykit' ), | |
| 419 | + /* translators: 1: URL. */ | |
| 420 | + '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') | |
| 421 | + /* translators: 1: URL. */ | |
| 422 | + .' '.wdk_sprintf(__( 'or check demo maps <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/maps'), | |
| 423 | + 'type' => \Elementor\Controls_Manager::TEXT, | |
| 424 | + 'default' => '', | |
| 425 | + 'condition' => [ | |
| 426 | + 'conf_custom_map_style' => [ | |
| 427 | + 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png', | |
| 428 | + 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png', | |
| 429 | + 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png', | |
| 430 | + 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png', | |
| 431 | + ], | |
| 432 | + ], | |
| 433 | + ] | |
| 434 | + ); | |
| 435 | + | |
| 436 | + $this->add_control( | |
| 437 | + 'carto_map_key', | |
| 438 | + [ | |
| 439 | + 'label' => __( 'Carto Map API Key', 'wpdirectorykit' ), | |
| 440 | + /* translators: 1: URL. */ | |
| 441 | + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://carto.com/basemaps/apikey/'), | |
| 442 | + 'type' => \Elementor\Controls_Manager::TEXT, | |
| 443 | + 'default' => '', | |
| 444 | + 'condition' => [ | |
| 445 | + 'conf_custom_map_style' => [ | |
| 446 | + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png', | |
| 447 | + 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', | |
| 448 | + 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png', | |
| 449 | + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png', | |
| 450 | + ], | |
| 451 | + ], | |
| 452 | + ] | |
| 453 | + ); | |
| 454 | + | |
| 455 | + $this->add_control( | |
| 456 | + 'thunderforest_map_key', | |
| 457 | + [ | |
| 458 | + 'label' => __( 'Thunderforest Map API Key', 'wpdirectorykit' ), | |
| 459 | + /* translators: 1: URL. */ | |
| 460 | + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.thunderforest.com/pricing/'), | |
| 461 | + 'type' => \Elementor\Controls_Manager::TEXT, | |
| 462 | + 'default' => '', | |
| 463 | + 'condition' => [ | |
| 464 | + 'conf_custom_map_style' => [ | |
| 465 | + 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png', | |
| 466 | + 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png', | |
| 467 | + 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png', | |
| 468 | + 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png', | |
| 469 | + 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png', | |
| 470 | + 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png', | |
| 471 | + 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png', | |
| 472 | + ], | |
| 473 | + ], | |
| 474 | + ] | |
| 475 | + ); | |
| 401 | 476 | |
| 402 | 477 | $this->add_control( |
| 478 | + 'google_map_key', | |
| 479 | + [ | |
| 480 | + 'label' => __( 'Google Map API Key', 'wpdirectorykit' ), | |
| 481 | + /* translators: 1: URL. */ | |
| 482 | + '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'), | |
| 483 | + 'type' => \Elementor\Controls_Manager::TEXT, | |
| 484 | + 'default' => '', | |
| 485 | + 'condition' => [ | |
| 486 | + 'conf_custom_map_style' => ['google_map'], | |
| 487 | + ], | |
| 488 | + ] | |
| 489 | + ); | |
| 490 | + | |
| 491 | + $this->add_control( | |
| 492 | + 'google_map_default_type', | |
| 493 | + [ | |
| 494 | + 'label' => __( 'Default Type', 'wpdirectorykit' ), | |
| 495 | + 'type' => \Elementor\Controls_Manager::SELECT, | |
| 496 | + 'default' => 'roadmap', | |
| 497 | + 'options' => array( | |
| 498 | + 'roadmap' => __( 'Roadmap', 'wpdirectorykit' ), | |
| 499 | + 'aerial' => __( 'Aerial', 'wpdirectorykit' ), | |
| 500 | + 'terrain' => __( 'Terrain', 'wpdirectorykit' ), | |
| 501 | + 'hybrid' => __( 'Hybrid', 'wpdirectorykit' ), | |
| 502 | + 'satellite' => __( 'Satellite', 'wpdirectorykit' ), | |
| 503 | + 'traffic' => __( 'Traffic', 'wpdirectorykit' ), | |
| 504 | + 'transit' => __( 'Transit', 'wpdirectorykit' ), | |
| 505 | + ), | |
| 506 | + 'condition' => [ | |
| 507 | + 'conf_custom_map_style' => ['google_map'], | |
| 508 | + ], | |
| 509 | + ] | |
| 510 | + ); | |
| 511 | + | |
| 512 | + $this->add_control( | |
| 403 | 513 | 'conf_custom_map_style_self', |
| 404 | 514 | [ |
| 405 | 515 | 'label' => esc_html__('Link to custom Map Style', 'wpdirectorykit'), |
| 406 | 516 | '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' ), |
| @@ -440,11 +550,9 @@ | ||
| 440 | 550 | ] |
| 441 | 551 | ] |
| 442 | 552 | ); |
| 443 | 553 | |
| 444 | - $WMVC = &wdk_get_instance(); | |
| 445 | - $WMVC->model('field_m'); | |
| 446 | - $fields_data = $WMVC->field_m->get(); | |
| 554 | + $fields_data = wdk_cached_field_get(); | |
| 447 | 555 | $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); |
| 448 | 556 | $order_i = 0; |
| 449 | 557 | |
| 450 | 558 | $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit'); |
| @@ -472,9 +580,9 @@ | ||
| 472 | 580 | $this->add_control( |
| 473 | 581 | 'title_field_id', |
| 474 | 582 | [ |
| 475 | 583 | 'label' => __( 'Title Field', 'wpdirectorykit' ), |
| 476 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 584 | + 'type' => \Elementor\Controls_Manager::SELECT2, | |
| 477 | 585 | 'default' => '', |
| 478 | 586 | 'options' => $fields_list, |
| 479 | 587 | ] |
| 480 | 588 | ); |
| @@ -482,9 +590,9 @@ | ||
| 482 | 590 | $this->add_control( |
| 483 | 591 | 'content_field_id', |
| 484 | 592 | [ |
| 485 | 593 | 'label' => __( 'Content Field', 'wpdirectorykit' ), |
| 486 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 594 | + 'type' => \Elementor\Controls_Manager::SELECT2, | |
| 487 | 595 | 'default' => '', |
| 488 | 596 | 'options' => $fields_list, |
| 489 | 597 | ] |
| 490 | 598 | ); |
| @@ -857,6 +965,7 @@ | ||
| 857 | 965 | wp_enqueue_style('slick'); |
| 858 | 966 | wp_enqueue_style('slick-theme'); |
| 859 | 967 | wp_enqueue_style('wdk-hover'); |
| 860 | 968 | wp_enqueue_script('slick'); |
| 969 | + wp_enqueue_script('leaflet-googlemutant'); | |
| 861 | 970 | } |
| 862 | 971 | } |