Arguments
Name | Type | Default | Description |
---|---|---|---|
id | string | A unique ID. This ID will be used to get the value | |
type | string | map | Type of the field |
title | string | Title of the field | |
default | array | Default value from database, if the option doesn’t exist | |
subtitle | string | Subtitle to display below the title. | |
desc | string | Description to display after the field | |
help | string | Text to display on right-corner (as hover/popup) of the field | |
class | string | Extra CSS classes (space separated) to append to the field | |
before | string | Content to display before the field | |
after | string | Content to display after the field | |
dependency | array | Define field visibility depending on other field value | |
attributes | array | Extra HTML attributes to append to the field | |
sanitize | string | Callback function for sanitizing value | |
validate | string | Callback function for validating value | |
EXTRAS | |||
placeholder | string | Search your address.. | The placeholder to be displayed when nothing is selected |
latitude_text | string | Latitude | The text to display the latitude field top |
longitude_text | string | Longitude | The text to display the longitude field top |
height | string | 250px | Value to set the default map height. |
Default Arguments
Name | Type | Description |
---|---|---|
address | string | String representing the default address of map. |
latitude | number | Number representing latitude in degrees. |
longitude | number | Number representing longitude in degrees |
zoom | number | Number representing map zoom level. |
Setting Arguments
Name | Type | Default | Description |
---|---|---|---|
scrollWheelZoom | bool | false | Whether the map can be zoomed by using the mouse wheel. |
For more information on customizing the Map field
Simple Map Field Example
array(
'id' => 'example-map',
'type' => 'map',
'title' => 'Map',
),
Map Field Example with Defaults
array(
'id' => 'example-map',
'type' => 'map',
'title' => 'Map with Defaults',
'default' => array(
'address' => 'New York, United States of America',
'latitude' => '40.7127281',
'longitude' => '-74.0060152',
'zoom' => '12',
)
),
Map Field with Assigned Address Field
array(
'id' => 'example-address',
'type' => 'text',
'title' => 'Address',
),
array(
'id' => 'example-map',
'type' => 'map',
'title' => 'Map',
'desc' => 'Use custom <strong>address_field</strong> field',
'address_field' => 'example-address',
),
Map Field with Advanced Options
array(
'id' => 'example-map',
'type' => 'map',
'title' => 'Map',
'height' => '500px',
'settings' => array(
'scrollWheelZoom' => true,
),
),
array(
'id' => 'example-map',
'type' => 'map',
'title' => 'Map',
'height' => '500px',
'settings' => array(
'scrollWheelZoom' => true,
),
),