# jetformbuilder/3.6.6/compatibility/jet-engine/blocks/map-field/tools.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.6. 58 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/compatibility/jet-engine/blocks/map-field/tools.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/raw/compatibility/jet-engine/blocks/map-field/tools.php
- Modified: 2024-08-13T13:45:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/compatibility/jet-engine/blocks/map-field/tools.php#L10-L20`.

```php
<?php


namespace JFB_Compatibility\Jet_Engine\Blocks\Map_Field;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

class Tools {

	const STRING  = 'location_string';
	const ARRAY   = 'location_array';
	const ADDRESS = 'location_address';

	public static function get_formats(): array {
		return array(
			array(
				'value' => self::STRING,
				'label' => __( 'String', 'jet-form-builder' ),
				'title' => __( 'String with location Lat and Lng separated by coma', 'jet-form-builder' ),
			),
			array(
				'value' => self::ARRAY,
				'label' => __( 'Array', 'jet-form-builder' ),
				'title' => __( 'Array with location Lat and Lng', 'jet-form-builder' ),
			),
			array(
				'value' => self::ADDRESS,
				'label' => __( 'Address', 'jet-form-builder' ),
				'title' => __( 'Location Address', 'jet-form-builder' ),
			),
		);
	}

	public static function is_supported(): bool {
		return (
			function_exists( 'jet_engine' ) &&
			version_compare( jet_engine()->get_version(), '3.0.3', '>=' ) &&
			jet_engine()->modules->is_module_active( 'maps-listings' )
		);
	}

	public static function get_help_message(): string {
		return sprintf(
			/* translators: %1$s - link to the JetEngine page, %2$s - link to the Map Listing tutorial */
			__(
				'The Map Field type requires both the <a href="%1$s">JetEngine</a> (3.0.3) plugin and its <a href="%2$s">Map Listing</a> feature to be activated.',
				'jet-form-builder'
			),
			'https://crocoblock.com/plugins/jetengine/',
			'https://crocoblock.com/knowledge-base/articles/jetengine-maps-listing-overview/'
		);
	}

}

```
