WordPress Interactive Map Plugin (CMML) - External API - Adding Locations Based on Current Location (REST API)
Adding Locations From External Services (REST API)
Example Uses
You can build an app with these buttons: "Create Location" and "Track Location".
- Generate Location - When accessed, creates a location entry in the plugin. Read more below
- Track Location - When accessed, starts tracking the user location in real time (Read the separate guide)
What is This Feature
With WordPress Interactive Map plugin it's possible to track the user location and send that information to the plugin.
How To Add Location Entry Based on GPS Location
Using the feature is simple:
- Adjust the settings (read more below)
- Create or generate a key
- Customize the URL, including the key
- Add the URL to your app
Generate Location URL - How to Use
The URL you will add in your is structured like this:
http://your-site.com/wp-json/cmloc/v1/add_location?description=yourdescription&name=your location name&LocCAT=category&LocLAT=50.401699&LocLONG=30.252512&key=abc123
The underlined green elements above can be customized.
- description
- name
- LocCAT
- LocLONG
- images (encode the images URL with base64. Example online tool)
- loc-address
- loc-postal-code
- loc-phone-number
- loc-email
- loc-website
- loc-email
- loc-url
- key - has to match the key set in the plugin's settings:
Example with all attributes
YWdlNC9pbWFnZXMvQi93b3JkcHJlc3Mtc3EucG5n|aHR0cHM6Ly93d3cuY21pbmRzLmNvbS93cC1j
b250ZW50L3RoZW1lcy9EaXZpL2hvbWVwYWdlNC9pbWFnZXMvQi93b3JkcHJlc3Mtc3EucG5n &loc-address=5th Street 29A&loc-postal-code=012345&loc-phone-number=11222333&loc-email=admin@route.com&loc-website=example.com/&key= 6240e806-3001-4164-81
Plugin Settings
Navigate to the Admin Dashboard → CM Map Locations Pro → Settings. Click on the Setup tab.
All settings are located under the Location REST API section.
- Enable REST API - Enable this feature.
- API key for adding location via REST API - Create your own key or click the button to generate a random one. This field is obligatory.
- Enter the IP from which you can connect - Leaving it empty allows connections from any IP - this might not be secure! To add multiple IPs, separate them with commas. For example: 1.1.1.1, 1.1.1.2, 1.1.1.3 etc.
- Create category if it doesn't exist - Enabled to let the plugin create the category if it doesn't exist.
- Don't add locations with the same name - Enable to prevent the plugin from creating locations with repeated names.
More information about the WordPress Interactive Map 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 |