Maps for WordPress users are now supported. Maps can be generated from user custom fields – just like generating maps from post custom fields. The individual user maps can be displayed using the shortcode, or combined into mashups with a user query.
User maps and mashups also have their own templates and filters (currently, the only filter is by role).
To create a user mashup, use the mashup shortcode with attribute ‘otype’ set to ‘user’. Here’s some examples:
[mashup otype="user" query="all"]
[mashup otype="user" query="role__not_in=subscriber"]
To support user maps, the MapPress database has been upgraded. Tables mappress_maps and mappress_posts have been consolidated into a single table, mapp_maps. Data in that table is stored in JSON, rather than serialized PHP objects, which makes it easier to read and edit. Indexes have also been added for several fields to speed up database access.
Images and Videos for POIs
It’s now possible to attach images and videos (such as YouTube) to map POIs. Images are displayed as a thumbnail or a gallery, for both individual maps and mashups.
For mashups, you’ll need to choose between showing POI data, including the attached images, or Post data, which will show the featured image for the underlying post.
Conversion to React
Although MapPress may not look different, internally the code is being rapidly converted from jQuery to React. Currently all of the back-end code, and about 30% of the front-end code has been converted.
New popup and list item templates are available in MapPress Pro version 2.75.7. The templates have been simplified, and the directions and thumbnails have been removed. There are also some small CSS changes.
These changes are required as part of the conversion to React, and to enable image galleries in popups (coming in the next release). Please update any existing custom templates to match the new defaults.
Thumbnails and directions are now added dynamically to map popups, based on the settings in the MapPress Pro ‘templates’ section.. A new setting is available to allow directions to be toggled on or off in popups:
New Map Import Screen
A new ‘Import’ screen has been added under the MapPress menu. This screen allows one or more maps to be imported from CSV files or directly from Google Sheets. Please see the sample file format and documentation links on the screen for more information.
A new settings has been added to connect all of a map’s POIs with lines. This make it easy to show a travel sequence between places, for example in a travel blog.
Leaflet supports straight lines. For Google, the lines can also be animated and geodesic (curved).
The line setting is global (for all maps) but it can be switched on or off for a single map using a shortcode parameter:
[mappress mapid="1234" lines="true"]
The built-in style editor now supports entering JSON directly for custom styles.
There’s a lot of new functionality for mashup filters:
- A new filter editor is available in the settings screen (see the image below)
- New filter types are available: post type, and text search.
- New filter display options are available in addition to checkboxes: radio buttons and a select dropdown
- Specific values can be included or excluded from filters (such as specific categories, or post types)
- A new setting allows the filter dropdown to be placed in the POI list, rather than along the top of the map
- The filter dropdown now displays a real-time count of matching POIs
- Filters now include user-definable labels
Minor improvement to mashup queries, video playback for YouTube videos, and bug fixes.
Various minor improvements including search for individual maps (similar to search for mashups), settings for POI list page size, and bug fixes.
Various minor improvements including better error reporting, and improved iframe support and license checking.
The built-in icon editor in the MapPress settings has been improved to support Google Material Icons, as well as additional color and size settings.
Improved ACF Integration
MapPress has always been able to generate maps from Advanced Custom Fields (ACF) text fields. Version 2.67 adds the ability to generate MapPress maps from ACF ‘map’ fields, which show an input map on the frontend.
If you prefer to maintain your map data in ACF, MapPress can now also just display the ACF locations on mashups, without generating a MapPress map.
More Filter Options
Settings have been added to control sorting and the display of term counts for mashup filters.
A Filter for Filters
A new WordPress filter ‘mappress_filter_label’ has been added for the filters dropdown, allowing user control of the term labels. See the documentation for details.
Gutenberg Sidebar Panel
A sidebar panel has been added for the Gutenberg editor. The panel shows all maps attached to the current post/page. Click on a map to edit it, or use the button to open the map library.
A setting for maximum zoom level has been added. Clusters will be disabled below this zoom. For Leaflet, it is also possible to enable or disable the ‘spiderfy’ effect, where clusters are exploded into their component markers at the maximum zoom,
All geocoders should now bias search results to the current viewport. For example, if you’re looking at a map of the world, entering “Paris” will return “Paris, France”. Zoom in on Texas, and the search search will return “Paris, TX”.
Search Bounding Box
A setting has been added to specify a bounding box for searches. If a box is entered, searches are restricted to only results that lie within the box. For example, “-75.32776,40.12009,-72.66632,41.31289” approximates New York City, and will limit results to that area.
This setting is available for every geocoder except Google (Google only supports biasing, not restriction).
A setting has been added to show the user’s location on mashup maps. It appears on the map like this:
The image can be overridden with a custom marker – just upload your custom image with the name ‘geolocation.png’.
Mashup Search Radius
The search radius for mashup maps can now be specified in the MapPress settings screen. The default is 200km. The radius is the minimum search radius. If larger region is entered, that will be used instead. For example, entering “Connecticut” will show the entire state, even if the search radius is small.
Overwrite Standard Icons
Any standard icon can now be replaced by uploading an icon with the same name. The original icon won’t be deleted, but it will be replaced by the custom version. For example, uploading a file with the name ‘blue.png’ will replace the standard blue marker. Delete the custom file to revert back to the standard.
WordPress 5.8 Compatibility
MapPress widgets have been updated to be compatible with the WordPress 5.8 block-based widgets screen.
MapPress has a ‘compatibility’ checkbox in the settings screen, which can be used to resolve plugin or theme conflicts. Checking the box will output all maps and mashups in iframes, which should insulate them from other plugins/themes that load the maps API, invalid CSS, etc.
A support page has been added to the MapPress main menu. This page include links and a Setup Wizard to assist in initial plugin configuration.
Lists throughout the plugin now have pagination controls. This makes navigation easier and speeds up rendering.
New list templates (Map List Item and Mashup List Item in the MapPress settings) and CSS rules have been introduced. The new templates allow featured images to be shown in the POI list.
Please be sure to update any custom templates to match the defaults. Templates can be edited in the MapPress settings, and the default templates are shown in the ‘default’ tab of the template editor.
The filters template (map-filters.php) has been updated. Multiple taxonomy filters can now be set in the MapPress settings and will display in the filters dropdown.
Please update any custom filter template in your child theme directory to match the new template.
Featured Image Position Settings
Settings have been added for setting the position of featured images (left, top… ) in both popups and lists.
Easier Custom Styles
A new map control has been added to select and edit custom styles. Click the control to bring up a dialog box with existing styles. New styles can downloaded from Snazzy Maps (for Google) or MapBox (for Leaflet). To set a default style, see the setting in the MapPress settings screen.
New Icon Picker and Color Picker
This version includes a new color picker and icon picker controls. Both controls are now written in React, which allows for additional functionality.
The color picker now allows a setting for specifying custom colors using the WordPress color picker.
The icon picker now includes the ability to upload icon files, and to create new map icons.
Icons are created by specifying a base shape, color, and a ‘glyph’ (a smaller icon to be displayed inside the shape). A .PNG file is generated for the icon when it’s saved, which can then be used normally in maps. This allows for millions of possible icon combinations, while still retaining the performance and caching benefits of .PNG map icons.
Here’s an example of creating a new icon – a red marker with a coffee cup inside it – using the icon generator.
The MapPress settings screen has been converted to React, which will allow new functionality in future releases.
New popup templates
This version adds new popup templates. The new mashup popup is designed to allow larger featured images, which can be placed on the left, top or right of the popup. For example, this is a popup with the featured image on the right:
The map template has also been updated for consistency, although it doesn’t support featured images.
Please update any custom map popup or mashup popup templates to match the new format (and CSS classes). The default templates can be viewed and copied from the ‘default’ tab in the template editor, found on the MapPress settings screen.
A New Editor
The map editor used in the WordPress classic editor has had a major rewrite. It should now be consistent with the Map Library and Gutenberg map editors. The editor will also detect the map ID to edit if it is opened while the cursor is inside a map shortcode.
A new setting is available to open POI popups when hovering over a map marker or an item in the POI list. If a marker is clicked, the popup remains open until it is closed or another marker is clicked.
Highlight the Selected Icon
The currently selected POI can now be highlighted with a circle or a special icon. See this section in the MapPress settings:
Embeds for POI Popups
POI popups now support embeds, just like the regular WordPress editor. Paste a link into the POI editor and it is automatically replaced with the embed. A list of embed types supported by WordPress is available here. Note that not all embed types will work in a POI popup – it depends on how the media embeds itself.
Here’s a a video of embedding YouTube video in a POI:
The infobox custom popup has been improved to size and pan better than before. Styling is easier (see file mappress.css for the CSS classes), and infoboxes are now available for Leaflet as well as Google.
Attaching Maps to Posts
Mashups work by finding posts that match a query and then displaying any maps attached to those posts – it’s similar in concept to the way a featured image is attached to a post.
Until now, maps were always attached to the post where the map was originally created. Version 2.58 adds the ability to detach or attach maps from posts, allowing maps to be moved from one post to another. From the post editor, maps can be attached to the current post (or detached), and from the map library, maps can be attached to any post.
New Map Editor for WordPress Classic Editor
MapPress supports both Gutenberg and the WordPress ‘classic’ editor. For the classic editor, the MapPress map editor has been redesigned and is now accessed by clicking the ‘MapPress’ button above the post body.
Add Media to POIS
MapPress now supports inserting media into map POIs directly from the WordPress Media Library. In the map editor, open a POI to edit and use the new ‘Add media’ link to insert images, videos, etc. Note that some media types will not work properly because of the way they are inserted into the page. For example, images and YouTube videos work fine, but TikTok will not work within a map.
MapPress now fully supports the Gutenberg editor, with new blocks for maps and mashups.
Existing shortcodes will continue to work, but they must be converted to blocks in order to edit the underlying maps. To convert a post to the Gutenberg block editor, select a ‘classic block’ and choose ‘convert to blocks’ from the block menu.
Shortcodes must be on a separate line, with no adjacent text or punctuation.
Here’s an example of converting a classic block to the Gutenberg editor. The [mappress] shortcode is converted to a MapPress Map block.
If a separate shortcode block already exists, just use the ‘change block type’ button to convert it to a Map or Mashup block.
MapPress has a new map library where you can see and edit all of your mapsThe library is located under the MapPress settings.
From the library, maps can be created, edited and deleted. A button exists to copy the shortcode for any map.
Both maps and Mashups now support marker clustering. Switch this option on from the MapPress settings screen. The Leaflet version is more advanced, and also supports “spidering” (separating markers when they are very close together).
Custom Icons Upload
Custom icons can now be uploaded directly from your computer, from the MapPress settings screen.
When maps are small, they now automatically go into ‘mini’ mode if the POI list is on the left. The list is hidden, and toggle button are shown to allow the user to toggle between ‘list’ and ‘map’ views. The mini mode size can be set in the MapPress settings.
MapPress has actually always supported WPML, and all map controls and templates default to the current WPML language. But 2.56 adds new functionality to assist in copying posts to a translation.
When creating a WPML translation, there is an option to duplicate the content from the original post, overwriting the target (translation) post.
During duplication, MapPress will:
- Delete any maps in the target (translation) post
- Copy all maps from the original post to the translation post
- Update all shortcodes and Gutenberg blocks to use the new map IDs
The new maps can be edited in the translation language and will not affect the originals. This behavior can be switched off in the MapPress settings screen.