{% import '_includes/forms' as forms %}

{{ forms.field({
	label: 'Initial Location'|t('simplemap'),
	instructions: 'The initial location and zoom that will show in the map field'|t('simplemap'),
}, map) }}

{{ forms.lightswitchField({
	label: 'Hide Search'|t('simplemap'),
	instructions: 'Hide the location search field'|t('simplemap'),
	id: 'hideSearch',
	name: 'hideSearch',
	on: field.hideSearch
}) }}

{{ forms.lightswitchField({
	label: 'Hide Map'|t('simplemap'),
	instructions: 'Hide the map'|t('simplemap'),
	id: 'hideMap',
	name: 'hideMap',
	on: field.hideMap
}) }}

{{ forms.lightswitchField({
	label: 'Hide Address'|t('simplemap'),
	instructions: 'Hide the address fields'|t('simplemap'),
	id: 'hideAddress',
	name: 'hideAddress',
	on: field.hideAddress
}) }}

{{ forms.lightswitchField({
	label: 'Show Latitude / Longitude'|t('simplemap'),
	instructions: 'Show the latitude / longitude fields'|t('simplemap'),
	id: 'showLatLng',
	name: 'showLatLng',
	on: field.showLatLng
}) }}

{{ forms.lightswitchField({
	label: 'Show Current Location'|t('simplemap'),
	instructions: 'Show a button to centre the map on the users current location'|t('simplemap'),
	id: 'showCurrentLocation',
	name: 'showCurrentLocation',
	on: field.showCurrentLocation
}) }}

{{ forms.selectField({
	label: 'Field Size'|t('simplemap'),
	instructions: 'Choose the size of the field to display'|t('simplemap'),
	id: 'size',
	name: 'size',
	options: {
		'normal': 'Normal'|t('simplemap'),
		'mini': 'Mini'|t('simplemap'),
	},
	value: field.size,
}) }}

{{ forms.selectField({
	label: 'Preferred Country'|t('simplemap'),
	instructions: 'When searching for a location, results in this country will take precedence. Be aware that some services will show results ONLY within this country.'|t('simplemap'),
	id: 'country',
	name: 'country',
	options: countries,
	value: field.country,
}) }}

{{ forms.textField({
	label: 'Min Zoom'|t('simplemap'),
	instructions: 'The minimum level the user can zoom the map out to.'|t('simplemap'),
	id: 'minZoom',
	name: 'minZoom',
	type: 'number',
	value: field.minZoom,
	min: 0,
	max: 18,
	step: 0.01,
}) }}

{{ forms.textField({
	label: 'Max Zoom'|t('simplemap'),
	instructions: 'The maximum level the user can zoom the map in to.'|t('simplemap'),
	id: 'maxZoom',
	name: 'maxZoom',
	type: 'number',
	value: field.maxZoom,
	min: 0,
	max: 18,
	step: 0.01,
}) }}

{% if settings.isW3WEnabled() %}
	{{ forms.lightswitchField({
		label: 'Enable what3words grid'|t('simplemap'),
		instructions: 'Will enable the what3words grid overlay when zoomed in above 17'|t('simplemap'),
		id: 'showW3WGrid',
		name: 'showW3WGrid',
		on: field.showW3WGrid
	}) }}

	{{ forms.lightswitchField({
		label: 'Show what3words field'|t('simplemap'),
		instructions: 'Show the what3words field for the selected location'|t('simplemap'),
		id: 'showW3WField',
		name: 'showW3WField',
		on: field.showW3WField
	}) }}
{% endif %}
