CM Map Locations - Add-on - User Location Tracking


Navigating the Locations Index Page

Back to Locations Plugin User Guide

Table of Contents

  1. What is This Add-on
  2. Installation
  3. Configuring and Using the Add-on
  4. Labels
  5. Troubleshooting

What is This Add-on

Example

The User Location Tracking Add-on help you show a button that adds your current location. The location is then displayed on a Google Map.


Installation

The process is the same with all CreativeMinds WordPress products.

Learn more: CM Map Locations (CMML) - Installation

TIP: Related Settings

Some options related to this feature such as path line, user marker, and tooltip on marker are managed in the User Tracking tab.

Learn more: CM Map Locations (CMML) - External API - Tracking User Location in Real Time (REST API) 


Configuring and Using the Add-on

1) Generate REST API Key

If you haven't done so, head to  Admin Dashboard → CM Map Locations Pro → Settings.

Then, under the Setup tab and Location REST API section, generate a key. 

2) Include Key

Now head to Admin Dashboard → CM Send User Location → CM Send User Location → General tab.

Under the General section, include the key you just generated and the server address attached to it.

Also, choose if you want to include the name field and the description field near the button or not, using corresponding options Enable name field (this option was introduced in version 1.0.5) and Enable description field.

Under the Google Map section you can configure adding temporary locations. Note: section with these options was introduced in version 1.0.8).

  • Enable Google Map - Enabling this option can solve some conflicts with other plugins or themes that also include the Google Maps API on each page, e.g. Geodirectory.
  • Google Maps App Key - Here you need to enter the Google Maps server app key. Get the API key from here and if you are facing "For development purposes only" message on Google Maps, please, read more here.
  • Disable embeding Google Maps JS API - Enabling this option can solve some conflicts with other plugins or themes that also includes the Google Maps API on each page, eg. Geodirectory.
  • default location's latitude - Enter the latitude of the default location shown in the editor.
  • default location's longitude - Enter the longitude of the default location shown in the editor.
  • default zoom - Choose default value of zooming in the editor. Greater number means closer zooming.

3) Use Shortcode

With everything configured, it's time to add the button to the site.

It's simple: apply the shortcode  [cm-user-location]

Parameters:

  • api - API Key
  • server - Server address (server which runs the API key)
  • identifier - You can pass your custom identifier. In case if this parameter is empty or not added to the shortcode, then the system will generate it automatically (note: this parameter was introduced in version 1.0.5)
  • name_enable - Name field, 1 to show or 0 to hide (note: this parameter was introduced in version 1.0.5)
  • name - Name field default text
  • description_enable - Description field, 1 to show or 0 to hide
  • description - Description field default text
  • bgcolor - User marker label background color, You can add it with and without "#", e.g. #ff0000, #008000, FFFFFF etc. (note: this parameter was introduced in version 1.0.5)
  • bgcolor_label - User marker label background color text. You can add any text, e.g. Red, Green, Blue etc. And this is used in the filter (note: this parameter was introduced in version 1.0.5)
  • button_text - Submit button text. If not defined then it will be taken from plugin settings labels section (note: this parameter was introduced in version 1.0.6)
  • user_location - Set "1" for post user current location or "0" for post temporary location. Default value is "1" (note: this parameter was introduced in version 1.0.8)
  • latlon_enable - Displays Latitude and Longitude fields. Set "1" to show or "0" to hide (note: this parameter was introduced in version 1.0.8)
  • latitude - Latitude field default value (note: this parameter was introduced in version 1.0.8)
  • longitude - Longitude field default value (note: this parameter was introduced in version 1.0.8)
  • drawing - Displays polygon draw tool on the map. Set "1" to show or "0" to hide. Default value is "0" (note: this parameter was introduced in version 1.0.9)
  • current_location - Displays current location button. Set "1" to show or "0" to hide. Default value is "0" (note: this parameter was introduced in version 1.1.0)

Shortcode Example

The shortcode in the Back-End:

Result on the Front-End:

TIP: What Are Shortcodes

Shortcodes add dynamic content to your site via a small piece of code.

Learn more: Shortcodes - How To Use


Labels

You can change all labels that appear in the Front-End. To do so, head to the Labels tab.

Example of Front-End Labels


Troubleshooting

Browser Compatibility

The API will only work starting on the following browser versions:

Browser Chrome Internet Explorer/Edge Firefox Safari Opera
Minimum version 5.0 - 49.0 (http)
50.0 (https)
9.0 3.5 5.0 16.0

Source: w3schools

How to Enable Geolocation in the Browser?

Each browser has a different process, but the principle is always the same.

Learn more: Chrome Chrome Mobile | Firefox | IE/Edge | Safari | Opera

Common Errors and Solutions

Error Cause Solution
User can't share their location or location is not precise enough Maybe device has poor or no geotracking capabilities User should use a device with GPS
Error: Server or API key is missing. Server or API key are missing Admin should add information in the plugin's settings
More: Documentation
Error: Geolocation information cannot be obtained. API was not accessed correctly Review API
More: Documentation
Server address not found. Server address in the settings does not match the API Admin should review the server address in the plugin's settings
More: Documentation
User denied the request for Geolocation. User didn't let browser collect geolocation information User should allow browser.
More: Chrome Chrome Mobile | Firefox | IE/Edge | Safari | Opera
Location information is unavailable. Likely, the current browser does not support HTML5 Geolocation API User should update browser or try a different one
More: w3schools
The request to get user location timed out. The server is not responding fast enough Admin should contact the hosting provider
An unknown error occurred. Many possible causes If it happens repeatedly, contact support

More information about the CM Locations Manager User Location add-on WordPress  Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us