Hi
I don’t want to get too involved in offering support or solutions but if you want geolocation on search then you can do the following.
Add this code to the header – you can do that is geodirectory design options:
<?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('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>
Then open up geodirectory-tempates > listing-filter-form.php and add at around line 46 just before the search button
<input type="button" class="geo" onclick="getLocation();" value="Find Me">
You can do basically the same with directions but the problem with directions is that the plugin currently uses the default location rather than the actual location.
You can see the geolocation hack at naturesites.co.uk
Kevin