Map

The Map field offers users the ability to search for map locations using the Google Maps API. It is very handy when outputting maps and markers on the front-end of theme pages, using latitude/longitude return values with the Google Maps API.

map

map-advance

Attributes

AttributesTypeRequiredDescription
idstringRequiredUnique ID identifying the field. It will be used as meta_key. Must be different from all other field IDs.
titlestringRequiredDisplays title of the option.
subtitlestringOptionalSubtitle display of the option, situated beneath the title.
descstringOptionalDescription of the option, appearing beneath the field control.
typestringRequiredValue identifying the field type. For Map field we set the value map
defaultstringRequiredArray of values specifying the default values of the map.
api_keystringRequiredString value of the API key to use with Google Maps.
js_optionsarrayOptionalArray values representing the Google JavaScript Maps. You can access to this link to refer MapOptions object specification: https://developers.google.com/maps/documentation/javascript/3.exp/reference
zoomintOptionalThe amount of zoom in which to set the map.
stylestringOptionalStyles to apply to each of the default map types. You also acess to this link to refer styles code https://snazzymaps.com/
placeholderstringOptionalText to appear in the search box when no data is present. Default value: Enter an address

 Example Declaration