Is there a way to create something like an embedded Google Map with the location of users embedded into it, either on a one-off basis (ie: manually created/updated 1x/month) or dynamically on the fly?
We run a private community website so the only people who could see it are the people who are logged in and have access. I looked around and while there is a Location field that appears on the user cards, I don’t see anywhere it’s surfaced in a way that allows us to either generate a map so that people can find & connect with one another individually or search for people within a geographic area if they happen to be visiting that region of the world.
Anyone have any thoughts here? I know that generally speaking, for a publicly available site there would be privacy concerns but these are generally not applicable to our community. Thanks!
This is still on our TODO list to be honest. I’m the co-host of MicroConf and got too busy to keep going down this road with all the other things that were going on and this fell down on the priority list. It’s something we’ll come back to, but I don’t have an exact timeline for when we’ll be looking at it because there are too many other things in the air.
I was asked to do something like this today. A fairly easy way to do it is to create the map of users on a WordPress site with an exising map plugin, and then use a custom onebox to embed it on your forum. I wrote a couple of functions in WordPress to add markers and some basic user-info to a map when the user fills out a ‘location’ field on their WordPress profile. I copied a onebox plugin that @fefrei posted on here yesterday to embed the map on the a forum.
With some changes that are being added to the wp-discourse plugin by @iamntz, it will soon be possible to use Discourse as an SSO provider for a WordPress site. Using that, it could be possible to set something up where one WordPress site provides a service like this to a number of forums.
This particular map plugin is quite good. It can potentially provide a lot of information.
Yes, I think that will be able to be done with using Discourse as an SSO provider for WordPress. The only difficulty I can see in using a location that is supplied as a user custom field on Discourse would be if there was some ambiguity in the location. For example, ‘Paris, United States’ returns 10 possible geolocations (supplied by the Mapzen Search API.) I currently have things setup so that the top result is selected. It looks like this can be quite accurate if ‘city’, ‘state/province’, and ‘country’ fields are all supplied.
If the location was entered on the WordPress site instead of on Discourse, it would be easier to add some validation to ensure that the correct location was being selected. This could be done with a dropdown menu populated with the results returned by a geolocation service.
I have never written a Discourse plugin, but what about this approach:
write a discourse plugin that creates a new route to access a geo file (either kmz or geojson). This plugin - the plugin would need to do already the conversion from location names to coordinates (a new data field could be introduced for each user that holds the coordinates and gets updated on each profile change)