Geolocation?

This topic contains 34 replies, has 7 voices, and was last updated by  Vikas 9 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #1685

    julian
    Free User
    Post count: 37

    Yeah, I know, I was just testing, and this corrected, thanks for your interest.
    I would not want to abuse your time, Kevin, but for me, which then display on your website, is perfect.
    What should I change to get the same thing on your website?
    Please see the attached image.
    Thank you

    #1688

    Kevin Heath
    Buyer
    Post count: 33

    Change the script in the header to

    
    
    
    <?php global $goe_locate; if($goe_locate){echo $goe_locate;} ?>
    <script type="text/javascript">
    function showLocation(position) {
      var latitude = position.coords.latitude;
      var longitude = position.coords.longitude;
      var add = latitude+','+longitude;
      document.getElementById('detail_page_map_canvas_fromAddress').value = add;
      document.getElementById('snear').value = add;
    }
    
    function errorHandler(err) {
      if(err.code == 1) {
        alert("Error: Access is denied!");
      }else if( err.code == 2) {
        alert("Error: Position is unavailable!");
      }
    }
    function getLocation(){
    
       if(navigator.geolocation){
          // timeout at 60000 milliseconds (60 seconds)
          var options = {timeout:60000};
          navigator.geolocation.getCurrentPosition(showLocation, 
                                                   errorHandler,
                                                   options);
       }else{
          alert("Sorry, browser does not support geolocation!");
       }
    }
    </script>
    
    

    In the listing-filter-form.php file immediately before you added the new input form add

    
    
    
      <input type="hidden" id="detail_page_map_canvas_fromAddress">
    
    

    In geodirectory-functions > map-functions > map_template_tags.php

    at around line 131 just before the button input add

    
    
    
    			 <input type="button" class="geo" onclick="getLocation();">
    
    

    If you want to can add a value to the input in the same way as you did with the search geo-locate.

    Kevin

    #1697

    julian
    Free User
    Post count: 37

    Thank you Kevin, I’ve got thanks to your help.
    Without you, I would not have done it.
    Greetings.

    http://sevilla.andeando.com

    #2926

    Tony Mattioli
    Expired Member
    Post count: 58

    Do you have a time frame for when geolocalization will be implemented in GeoDirectory (plugin or not).

    Thanks

    #3010

    Vikas
    Full Member
    Post count: 1128

    Hi,

    Yes it has been implemented already but we are building more stuffs to include in next release.
    Thanks for ur patience.

Viewing 5 posts - 31 through 35 (of 35 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket