Feature Request for Google Maps Plugin

I am wondering if it would be possible to add a feature or add-on to the Google Maps plugin to be able to calculate the user's location based on a given start point (point A coordinates), a given end point (point B coordinates) and the number of kilometers covered start from point A.

The reason why I would prefer to stick to using the Google Maps plugin is because of its existing BuddyPress integration.

If this is not a good feature for the plugin, would it be too inappropriate for me to ask here if there are other plugins that can do this?

Thanks so much for your assistance with this.

    Saurabh

    Hi @gOObs,

    Hope you are well today!

    I am wondering if it would be possible to add a feature or add-on to the Google Maps plugin to be able to calculate the user's location based on a given start point (point A coordinates), a given end point (point B coordinates) and the number of kilometers covered start from point A.

    I apologise but I don't understand that well enough. What I understand from this is that you wish to calculate the distance between two points. Then, if a user starts (say cycling) from the starting point and doesn't make it to the end point, you want to able to plot that? Could you probably give an example to clarify?

    Once I understand what you are trying to achieve, I'd be able to help with a solution.

    Best

    Saurabh

    gOObs

    Hi Saurabh,

    I'll attempt to clarify with an example. What I am trying to develop is to have users sign up to a 'race challenge' where they first specify their starting point. The challenge may take 2 weeks to complete and during the 2-week period, each competitor logs in to update their progress (location). They update their location by specifying a number of kilometres (distance) covered since the start of the race and the map will automatically calculate the new marker on the map based on the following:

    a) the starting point they originally specified

    b) the distance (in KMs) they enter each time when they update their location

    c) the end point (that we already know as the creators of the race)

    What we're trying to achieve here is the automatic calculation of the user's progress by identifying his/her new location on the map each time he enters a new distance. Is this more clear?

    Saurabh

    Hi @gOObs,

    That sounds very interesting!

    The challenge may take 2 weeks to complete and during the 2-week period, each competitor logs in to update their progress (location).

    I'm not sure if you have considered letting them update their current location which is a very simple process using the HTML5 geolocation API: http://html5demos.com/geo. An addon allows the recording of current location. With a few tweaks, you'd be able to achieve what you looking for. Unless, the participants don't have smartphones, I'd recommend this, since it is very easy and we can help out faster with this.

    They update their location by specifying a number of kilometres (distance) covered since the start of the race and the map will automatically calculate the new marker on the map based on the following:

    a) the starting point they originally specified

    b) the distance (in KMs) they enter each time when they update their location

    c) the end point (that we already know as the creators of the race)

    Calculating distances using Google maps is a fairly complicated process. While it is easy to calculate displacement from point A to B, the actual distance might involve several factors like the shape of the route (which won't be a straight line), the elevation of the ground level, etc. The Google Maps API, is a good place to look: https://developers.google.com/maps/documentation/javascript/reference

    Unfortunately, implementing such a functionality isn't in the roadmap. Unless more users bump this up, it will only bloat the plugin for most users.

    Although, a bit complicated, this is very doable and I'd recommend hiring a developer to create this for you. you could hire one from numerous marketplaces, including this one:

    https://premium.wpmudev.org/wordpress-development/

    We can help with directions and ways to integrate with the Google Maps plugin, once you have them on board.

    I hope this helps.

    Do let me know if you need more help with it.

    Best

    Saurabh

    gOObs

    I'm not sure if you have considered letting them update their current location which is a very simple process using the HTML5 geolocation API: http://html5demos.com/geo. An addon allows the recording of current location.

    Unfortunately, the users do not update their location while they are running the race, so this wouldn't work. I'll probably have to look for another solution.

    Saurabh

    Hi @gOObs,

    Hope you are well today.

    Unfortunately, the users do not update their location while they are running the race, so this wouldn't work. I'll probably have to look for another solution.

    I don't mean they should update while running. I meant, at the time that they are expected to log in and update the distance they've covered, they could just update their current location.

    I couldn't find a generic plugin that could help with your need. However, like I have stated, this is something that you'd need to get custom coded.

    I could be wrong though . If you do find such a plugin, kindly let us know, as well. Any one else from the community looking for a similar solution will benefit immensely.

    Best

    Saurabh