CM Map Locations (CMML) - Integration - CM Business/Expert Directory
Integration with CM Business/Expert Directory
Table of Contents
- What is This Feature
- Video Tutorial
- Expert + Business Directory
- Expert Directory
API Key is Required
This feature requires an API key from Google. Learn how to generate one:
What is This Feature
CM Map Locations can be integrated with the CM Business Directory and CM Expert Directory plugins.
This way, you can add a map to the listing of business or experts.
The following video shows the integration using the Business Directory as an example.
Business and Expert Directory
1) Showing Maps With Businesses / Experts
You can display the map by using adding a shortcode.
It has two attributes:
- category - Specify one or more categories by their id or slug
- categoryfilter - Set "1" to allow users to filter categories and "0" to disable it (Default is "1")
Business Directory Shortcode
Expert Directory Shortcode
Latitude and Longitude are Required!
The map will only display items that have latitude and longitude in their address.
You can add them by choosing the precise point on the map. To do so, enable the option "Place the marker manually".
Alternatively, you can use services such as Get Lat Long from Address Convert Address to Coordinates to obtain coordinates.
2) ZIP Search in Directory
You can enable a ZIP search filter in both directories as well. This includes both a ZIP code filter and a Radius dropdown.
Enabling ZIP Search
To enable this filter, you have to check the CM Map Locations setting. Head to Admin Dashboard → CM Map Locations → Settings.
Click on the Appearance tab.
Scroll down to the ZIP code radius filter section.
- Enable ZIP code radius filter - Adds the two search boxes: ZIP filter and Radius.
- Country code for the ZIP code searching - The ZIP filter will work only within a single country. Note: it works only within a single country that you've set up in the settings.
Note that geolocation does not work with Business and Expert Directories.
Still in this screen, you can also set the Radius field increments. Learn more CM Map Locations (CMML) - Searching by ZIP - CreativeMinds Products Documentation
ZIP Code Comes From Coordinates
The Zip code of the business/expert is fetched from the coordinates, and not from the Postalcode field.
The postalcode field is used as a public information you can show on the page
3) Business/Expert Pages With a Map
You can also show a Google map on each listing page.
Choose the default options in WP Admin → CM Expert/Business Directory Pro → Settings → Page → Page Defaults.
Then configure Show a Google map and Display map (where and how it should be shown).
TIP: Enabling/Disabling on Single Page
While editing a business or expert page, you can toggle the map on or off for that page alone.
Expert Directory Only
Expert Directory With a Map
You can show a Google map on the expert directory
Check WP Admin → CM Expert Directory Pro → Settings → Expert Directory.
- Show CM Locations Map - Shows the map or not
- Show map on page load - Show the map by default or with a button click. Disabling might be recommended if the map takes time to load
- Shows all experts on map - Show all experts or only the ones shown in the current page
Then navigate to WP Admin → CM Map Locations Pro → Settings → Index Page.
Find the section Map and configure the following options:
- Enable map - Enable this option to display the map on the Expert Directory page.
- Enable marker clustering - If enabled, multiple markers will be combined as a single when overlapping due to the zoom.
- Enable info window on marker clustering - Shows a tooltip when clicking on a clustered marker, listing each location.
- Marker label type - Choose the label type with the marker's name on the location's map. The options are:
- Show always below the marker
- Show tooltip on mouse hover
- Do not show label
- Clicking on the map marker will - Choose the action when the user click on the marker. The options are:
- Open the location's page - Directs to the expert page
- Redirect to custom URL - Directs to the address in the "URL" field of the location entry.
- Show tooltip with information about location - Displays part of the description without directing the user to another page. This feature has extra settings.
Example on the Front-end: