WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Geo my wp integration (10 posts)

  1. momoed
    Member
    Posted 7 months ago #

    Hello , thanks for your great plugin !!

    I would like to incorporate geotagging with the Geo my WP plugin in the search form. Thus the user is not required to describe its location in the search form.
    Could you help me for that ?

    Thanks .

    http://wordpress.org/support/plugin/events-manager

    http://wordpress.org/plugins/events-manager/

  2. caimin_nwl
    NetWebLogic Support
    Posted 7 months ago #

    Hi,

    Glad you're enjoying the plugin!

    Can you tell us a bit more about what you want to do? Sounds like you want to remove the search form completely and just rely on geolocation?

  3. momoed
    Member
    Posted 7 months ago #

    Thanks for answer,

    I don't want to remove the search form, I want to add geolocation in the form, for example, by clicking the button above the marker location field and have the address directly without the need to write. But leave the choice anyway to user to write manually his location.

  4. philipjohn
    Member
    Posted 7 months ago #

    Hiya,

    Do you mean when adding an event?

    If so, I believe the best thing for you to do is build your own method of selecting the location from a map, and an API (such as Google Maps) to fill the relevant location fields that EM expects to receive.

    You can so this by providing customised templates for the form. See http://wp-events-plugin.com/documentation/using-template-files/

    Cheers,
    Phil

  5. momoed
    Member
    Posted 7 months ago #

    Hi Phil,

    When an event is created , user must inform his location. In my home page, I've the search form with location field. I want integrate the address automatically in this field when user click on the button "Get current location" for example,therefore when he send his location , events near his city appear.

  6. caimin_nwl
    NetWebLogic Support
    Posted 7 months ago #

    What you'd need to do in that case is write some custom code that finds the user location using the HTML5 geolocation feature and adds the address to the Events Manager search box using jQuery.

    This should help with getting the user location:
    http://www.w3schools.com/html/html5_geolocation.asp

  7. momoed
    Member
    Posted 7 months ago #

    hi,

    I implemented geolocation but I can't integrate the values ​​in the location box using jQuery. Could you help me for that?

    Thanks

  8. momoed
    Member
    Posted 7 months ago #

    This is the code :

    function getLocation()
      {
      if (navigator.geolocation)
        {
        navigator.geolocation.getCurrentPosition(showPosition, showError);
        }
      else{alert("Geolocation is not supported by this browser.");}
      }
    
    function showPosition(position)
      {
     var lat=position.coords.latitude;
     var lng=position.coords.longitude;
     var geocoder = new google.maps.Geocoder();
     var latlng = new google.maps.LatLng(lat, lng);
     var addr =
     geocoder.geocode({'latLng': latlng}, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
    	var numero = results[0].address_components[0].long_name;
    	var rue = results[0].address_components[1].long_name;
    	var codeP = results[0].address_components[6].long_name;
    	var ville = results[0].address_components[2].long_name;
    	var adresse = numero+" "+ rue + " "+ codeP +" "+ ville;
    	alert(adresse);
    
          }else{
    	alert("Le geocodage n\'a pu etre effectue pour la raison suivante: " + status);
          }
     });
    }
  9. philipjohn
    Member
    Posted 7 months ago #

    That's not something we can really help you with here as this is only for plugin support, not custom development.

    You might want to try places like StackExchange for that

  10. momoed
    Member
    Posted 7 months ago #

    Thanks , I've included the address in the correct field. But I have to click on the pre-written address to select the autocomplete address and therefore launch search.

Reply

You must log in to post.

About this Plugin

About this Topic