Something I have been asked to add on a few occasions for community based forums is a map of the site user’s locations. For a larger community this can be a chance to show the variety in locations of their members. ocPortal has an addon created specifically for this purpose. To add a Map of your Users locations there are a few steps to follow:-
- Go to the Adminzone
- Navigate to the structure section and choose Addons
- Scroll down and choose Import non bundled addons
- Click download and choose the Information display option
- The addon is called ocUserMap
- Click Import non-bundled addon(s) button
- Click Proceed if none of the fileswill make any changes to files you have edited yourself
- Once you return to the addons screen you will need to install the newly imported addon.
- Scroll down the list until you get to ocUserMap and click the Green + icon to install the addon.
Now your map addon for this is fully installed, I recommend adding your location on your profile so when you add the content block to a page you will be able to see if it is working correctly. To be able to do this you need to know your latitude and longitude coordinates. A simple website to find these is: http://itouchmap.com/latlong.html. Once you have the latitude and longitude go to your profile page on your website and click edit.
Once you are on the profile edit screen choose the profile tab at the top of the screen. Scroll down to two new fields which have been added called latitude and longitude. Input your coordinates and click save.
If you are creating a new page on which to display the usermap, you will need to create this next, or if you are adding it to an existing page, you need to go to that page and click edit. You can add the information block for this map in exactly the same way you would add any other information block to your website which is by clicking the add block icon (if you are using the WYSIWYG editor is on the third line near the right hand side of the icons and looks like a red square).
On the add block screen scroll down until you see the block title called:
Display’s a Google map with user locations marked by markers. (main_google_map_users)”
Choose this block and fill in the screen accordingly i.e. title etc. I usually make the map a voluntary feature and un-tick the Geolocate User option which will locate where users are and add the data to their profile. You can also choose the size of the map which will appear and choose to center the map around the markers which are added. If you choose this latter option the map may look a bit strange where it is centered until you have a few entries.
You can now preview the block or click “Use” and ocPortal will add it to your page., Click save on the page you are editing and the Map should now appear.