Map Field Overview

The Map field block displays maps (Google, Leaflet, and Mapbox) with set zoom parameters (zooming to a specific country). The field block allows:

  • inputting coordinates by pinning the needed location on the map;
  • storing the data location in three different ways: as a string with location Lat and Lng separated by a comma, as an array, and as a physical address;
  • saving its values conveniently into the Map meta field of the JetEngine plugin.
NOTE

To use the Map field block, install and activate the JetEngine (v3.0.3 or higher) plugin, enable its Map Listing Module, and set the Maps Settings options (i.e., select the “Google Maps” option from the Map Provider drop-down menu and paste an API Key).

This field block has the following groups of settings: General, Value, Map Settings, and Advanced.

map field block settings

The General settings include the FIELD LABEL, FORM FIELD NAME, and FIELD DESCRIPTION fields. The FIELD LABEL and FIELD DESCRIPTION fields allow the usage of shortcodes.

map field block general settings

The Value settings allow specifying the location center using coordinates and setting the map zoom. Use the VALUE FORMAT field is intended to choose how to store the location by clicking the appropriate button (“String,” “Array,” or “Address”) and enter the latitude and longitude coordinates in the DEFAULT VALUE field:

map field value settings
  • String – the coordinates will be stored as a string with location latitude and longitude separated by a comma. For example: 46.969686110698525,31.991035188696703;
  • Array – the location will be stored as an array of latitude and longitude. Example: {“lat”:46.969686110698525,”lng”:31.991035188696703};
  • Address – the coordinates will have the format of a physical address, like this: 6 Walnut Road, Manchester SW1A 1AA, UK.
NOTE

While the location can be stored in three different formats, manual input in the DEFAULT VALUE field is available only in the String format, i.e., 50.45,30.53. This format works regardless of the options set in the VALUE FORMAT field.

The DEFAULT VALUE field allows usage of the dynamical data by pressing the Dynamic Tag sign. It opens the Edit Preset pop-up for selecting a data source from options like “Post,” “User,” “URL Query Variable,” and “Option Page.” The preset can be a Map field type created with JetEngine or a text field (the Text, Select, or Radio fields) with coordinates in the String format (46.96,31.99).

dynamic data as a source for map data

The ZOOM field of the Value settings has three buttons to set the Default, Small, and Custom zoom. Clicking the “Custom” button enables a field to type a zoom value ranging from 1 to 18.

zoom field of the value settings

The Map field block on the front end looks as follows:

front-end view of the map field block

The Map Settings has the HEIGHT slider to set the map dimensions. The map height can be adjusted between 50 and 1000 pixels. Pressing the “Reset” button sets a 300-pixel height.

height slider of the map settings

Setting a small map height doesn’t impact the map width on the front end.

front end of a small map

Use the JetStyleManager plugin to customize the Alignment, Border, Color, Margin, Padding, Typography, and more map options.

That’s all about the Map field block settings.