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

  1. momoed
    Posted 2 years 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 .



  2. caimin_nwl
    NetWebLogic Support
    Posted 2 years ago #


    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
    Posted 2 years 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. Philip John
    Posted 2 years ago #


    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/


  5. momoed
    Posted 2 years 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 2 years 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:

  7. momoed
    Posted 2 years ago #


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


  8. momoed
    Posted 2 years 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("Le geocodage n\'a pu etre effectue pour la raison suivante: " + status);
  9. Philip John
    Posted 2 years 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
    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic