Can we add geolocation to find point of event on the map?

Home Forums Calendar Products Events Calendar PRO Can we add geolocation to find point of event on the map?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1107430
    fifteen15studios
    Participant

    Hi Modern Tribe,

    We would like to have events added to the map view (in Advanced Filter Bar) automatically by reading the address. Is there a way to add a Google Geolocation API to the map so we can do this?

    Thanks,
    Brendan

    #1107542
    Cliff
    Member

    Hi Brendan.

    I’m not sure I fully understand your request.

    The PRO plugin does use the Google Maps Geocoding API to obtain the latitude/longitude coordinates for each Venue that has an address that Google can geocode.

    Also, our iCal Importer has similar code to obtain the coordinates for a Venue when it’s imported.

    Then our Map View displays events on a map (for the events assigned a Venue that has coordinates).

    Maybe it’d be helpful for you to reference our Maps Settings and the Troubleshooting Map View article and let me know if you have any follow-up questions.

    Thanks!

    #1108155
    fifteen15studios
    Participant

    Cliff,

    Thanks for replying! I guess I didn’t think that through.

    It looks like the issues is more with reporting distance than it is with geolocation. There are lat and long data in the listings so that’s all set. My problem is that my site only seems to report distance on the map view, and only under certain conditions.

    I’m using the function to get the distance, and it seems to be working IF I have a location selected (which makes sense) and IF I am in map view (at at certain times, only IF I’m working in Firefox). If I’m in any other view, the distance seems to not work.

    I’m going to add some information to this in a private reply so you can see what I’m talking about.

    Thanks!
    Brendan

    #1108157
    fifteen15studios
    Participant

    This reply is private.

    #1108443
    Cliff
    Member

    Thanks for all the info.

    Observation: I’m guessing you filtered the Cost display to output the distance instead, since the distance is in the .list_event_schedule_cost element.

    Could you please provide the code/customization you have implemented so I can take a closer look?

    #1108962
    fifteen15studios
    Participant

    Hmm.. I’m not sure what you mean. I’ll add my code for the page, but the display has to do with this snippet:

    <?php 
    			if ( ! empty( $post->distance ) ) {
    				echo tribe_get_distance_with_unit( $post->distance ); 
    			} else {
    				echo "<i>Distance Not Listed</i>";
    			}
    		?>
    #1108963
    fifteen15studios
    Participant

    This reply is private.

    #1109009
    Cliff
    Member

    Thanks for the additional info.

    I wasn’t quite sure how to help so one of our developers helped.

    This snippet may be of use to you, but if it’s not you’ll need to work things out yourself or reference our list of known customizers because it’s outside our Scope of Support / Terms.

    Here it goes:

    // Get the post list for the current query
    global $wp_query;
    $posts =& $wp_query->posts;
    
    // Get current coords - needs safety checks
    $lat = $_REQUEST['tribe-bar-geoloc-lat'];
    $lng = $_REQUEST['tribe-bar-geoloc-lng'];
    
    // Assign distance values
    $tribe_geo = Tribe__Events__Pro__Geo_Loc::instance();
    $tribe_geo->assign_distance_to_posts( $posts, $lat, $lng )

    If you feel our plugin needs some sort of enhancement, please post it to our UserVoice page.

    If you post it, feel free to link to it from here in case anyone comes across this forum thread in the future.

    #1114601
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Can we add geolocation to find point of event on the map?’ is closed to new replies.