field, [ 'placeholder' => esc_html__( 'Search...', 'adminify' ), 'latitude_text' => esc_html__( 'Latitude', 'adminify' ), 'longitude_text' => esc_html__( 'Longitude', 'adminify' ), 'address_field' => '', 'height' => '', ] ); $value = wp_parse_args( $this->value, [ 'address' => '', 'latitude' => '20', 'longitude' => '0', 'zoom' => '2', ] ); $default_settings = [ 'center' => [ $value['latitude'], $value['longitude'] ], 'zoom' => $value['zoom'], 'scrollWheelZoom' => false, ]; $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : []; $settings = wp_parse_args( $settings, $default_settings ); $style_attr = ( ! empty( $args['height'] ) ) ? ' style="min-height:' . esc_attr( $args['height'] ) . ';"' : ''; $placeholder = ( ! empty( $args['placeholder'] ) ) ? [ 'placeholder' => $args['placeholder'] ] : ''; echo wp_kses_post( $this->field_before() ); if ( empty( $args['address_field'] ) ) { echo ''; } else { echo '
'; } echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo wp_kses_post( $this->field_after() ); } public function enqueue() { if ( ! wp_script_is( 'adminify-leaflet' ) ) { wp_enqueue_script( 'adminify-leaflet', esc_url( $this->cdn_url . $this->version . '/dist/leaflet.js' ), [ 'adminify' ], $this->version, true ); } if ( ! wp_style_is( 'adminify-leaflet' ) ) { wp_enqueue_style( 'adminify-leaflet', esc_url( $this->cdn_url . $this->version . '/dist/leaflet.css' ), [], $this->version ); } if ( ! wp_script_is( 'jquery-ui-autocomplete' ) ) { wp_enqueue_script( 'jquery-ui-autocomplete' ); } } } }