Show Map Locations for All Users with ProfileGrid
If you maintain a membership website where you can show map locations for all users, you get a chance to standout among competitors. By displaying map locations of your site users, you get to show your online reach. It will also help your site visitors check from where most of the users are registering to your site. The map also gives you real-time access to stats of all logged in users.
The WordPress ProfileGrid plugin helps you generate maps showing locations of all registered users on your website. In this article, I will help you show map locations for all users with ProfileGrid.
Activating Geolocation On ProfileGrid
The ProfileGrid plugin offers a few extensions, some are free and some are part of the premium pack. Geolocation comes with the premium pack unlike bbPress and WooCommerce Integration, User Display Name and User Profile Custom Slugs extensions. In order to show map locations for all users, you need to activate the Geolocation extension from the ‘Extensions’ page.
Right after activation, the extension becomes part of the ‘Global Setting’ page. Then, when you click on the ‘Geolocation’ option you land on a page called the ‘Geolocation Setting Page’.
From here, you can select the expanse of your map whether it should be country-specific or that of the entire world. You can choose the level till which you want to zoom your map. Also, here you get the option to retrieve your Google API Key. By clicking on ‘You can sign up for a key HERE’, you land on a page, similar to the one given below.
From here, you select ‘Create a Project’ if you don’t have an API key already. Eventually, Google will provide you with an API key with which you can show map locations for all users.
Features of the Geolocation Extension
The extension, apart from adding a Google Map on site, lets you choose the Group from which you want to show the locations of the users. The location of Group members in an area is aggregated based on zoom in/out for the map. Individual locations of Group members can be seen by zooming in on the map. The extension picks up location data automatically from the group registration form. By clicking on an individual Group member’s location, a popup appears displaying the member’s name, Group name and profile picture.
Placing the Map on a Page
The ProfileGrid plugin apart from its array of extensions offers some very useful shortcodes. In fact, it has a whole page dedicated to shortcodes. The Geolocation Map can be displayed on any page. Now, in order to display the map on the frontend, you have to use the shortcode [PM_USERS_MAP].
Copy it from the ProfileGrid shortcode page and show map locations for all users in any page of your choice.
We can customize the Shortcode results using parameters. Users can apply the following parameters to control shortcode results:
1. gid – Used for showing a specific Group(s) members by passing in the group IDs (comma separated)
2. exclude_users – Used for excluding specific users by passing in the user’s IDs (comma separated)
3. relative_time – Used for showing locations of only those members that have registered during a specific time span (today, yesterday, this_week, last_week, this_month, this_year)
4. info_popup – Used for showing or hiding the information popup when a viewer clicks on a member’s location maker
Given below is an example of a shortcode with parameters. We have pasted it on a new ‘Map’ page.
This will ensure that the locations of all the users from groups 1,2,3 will be shown on the map with an info pop-up.
In the above picture, we see the locations of all the users on the Google map with an info pop-up showing their details.
Utility and Consumer Convenience
The utility of being able to show map locations for all users on your website is many. You can show the branches of your company with their area heads on these maps. You can show the far-reaching extent of your staff members who are working from various parts of the world. Also, you can check from which area you are getting users on your site. However, all this just couldn’t be possible without the powers of the ProfileGrid plugin.