CM Map Locations - Add-on - User Location Tracking
Navigating the Locations Index Page
Table of Contents
What is This Add-on
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.
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.
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
- 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)
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
You can change all labels that appear in the Front-End. To do so, head to the Labels tab.
Example of Front-End Labels
The API will only work starting on the following browser versions:
|Minimum version|| 5.0 - 49.0 (http)
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
|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
|Error: Geolocation information cannot be obtained.||API was not accessed correctly|| Review API
|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
|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
|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|