Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
Version 9
Harold Hemberger
0 points
Beginner
When I have a listing that allows for Google Map it show an area or approx. 700 km. This is way to large for a local area. How can I get this to a zoom of about 12. Here is what I tried
The file I tried to edit is in directory …/class/class_core.php.
It is a long file so I will just show the section.. I changed $default_zoom = 8;
to
$default_zoom = 12;
website is https://www.buyinkingston.com. to se what I am talking about select the restaurant or the salon. Thanks
/* =============================================================================
GOOGLE MAP DISPLAY FUNCTION FOR SEARCH RESULTS PAGE
========================================================================== */
When I have a listing that allows for Google Map it show an area or approx. 700 km. This is way to large for a local area. How can I get this to a zoom of about 12. Here is what I tried
The file I tried to edit is in directory …/class/class_core.php.
It is a long file so I will just show the section.. I changed $default_zoom = 8;
to
$default_zoom = 12;
website is https://www.buyinkingston.com. to se what I am talking about select the restaurant or the salon. Thanks
/* =============================================================================
GOOGLE MAP DISPLAY FUNCTION FOR SEARCH RESULTS PAGE
========================================================================== */
function MilesToMeters($num){
if($num == “” || $num == 0){ return 0; }
$unit = strtoupper($GLOBALS[‘CORE_THEME’][‘geolocation_unit’]);
if ($unit == “K”) {
return $num/0.001; // 1 meters = 0.001 KM;
} else {
return $num/0.00062137119; // 1 meters = 0.00062137119 miles;
}
}
function wlt_google_getradius(){
if(!isset($_GET[‘zipcode’])){ return; }
$saved_searches = get_option(‘wlt_saved_zipcodes’);
$longitude = $saved_searches[$_GET[‘zipcode’]][‘log’];
$latitude = $saved_searches[$_GET[‘zipcode’]][‘lat’];
$radius = 1;
if(isset($_GET[‘radius’]) && is_numeric($_GET[‘radius’]) ){
$radius = $_GET[‘radius’];
}
return array(“zip” => $_GET[‘zipcode’], “long” => $longitude, “lat” => $latitude, “dis” => $this->MilesToMeters($radius) );
}
function wlt_google_getdefaults(){
// REGION
$region = “us”; $lang = “en”;
if(isset($GLOBALS[‘CORE_THEME’][‘google_lang’])){
$region = $GLOBALS[‘CORE_THEME’][‘google_region’];
$lang = $GLOBALS[‘CORE_THEME’][‘google_lang’];
}
// GET DEFAULT ROOM AND COORDS FROM ADMIN
if(isset($GLOBALS[‘CORE_THEME’][‘google_coords1’]) && $GLOBALS[‘CORE_THEME’][‘google_coords1’] != “”){
$ff = explode(“,”,$GLOBALS[‘CORE_THEME’][‘google_coords1’]);
$latitude = $ff[1];
$longitude = $ff[0];
}
if(isset($GLOBALS[‘CORE_THEME’][‘google_zoom1’])){ $default_zoom = $GLOBALS[‘CORE_THEME’][‘google_zoom1’]; }
// CHECK IF THIS IS A ZIPODE SEARCH
if(isset($_GET[‘zipcode’]) && ( strlen($_GET[‘zipcode’]) > 2 && strlen($_GET[‘zipcode’]) < 9 ) ){
$saved_searches = get_option(‘wlt_saved_zipcodes’);
if(isset($saved_searches[$_GET[‘zipcode’]][‘log’])){
$longitude = $saved_searches[$_GET[‘zipcode’]][‘log’];
}else{ $longitude =0; }
if(isset($saved_searches[$_GET[‘zipcode’]][‘lat’])){
$latitude = $saved_searches[$_GET[‘zipcode’]][‘lat’];
}else{ $latitude =0; }
}
// SET COORDS TO USERS LOCATION IF ORDERING BY DISTANCE
if(isset($_SESSION[‘mylocation’][‘lat’]) && strlen($_SESSION[‘mylocation’][‘lat’]) > 0 && strlen($_SESSION[‘mylocation’][‘log’]) > 0 && isset($GLOBALS[‘CORE_THEME’][‘geolocation’]) && $GLOBALS[‘CORE_THEME’][‘geolocation’] != “”){
$latitude = strip_tags($_SESSION[‘mylocation’][‘lat’]);
$longitude = strip_tags($_SESSION[‘mylocation’][‘log’]);
}
// CHECK AND VALDATE
if($longitude == “”){ $longitude = 0; }
if($latitude == “”){ $latitude = 0; }
$default_zoom = 12;
return array(“region” => $region, “lang” => $lang, “zoom” => $default_zoom, “long” => $longitude, “lat” => $latitude );
}
Members Only Content
This reply is for PremiumPress customers only.
Login NowMembers Only Content
This reply is for PremiumPress customers only.
Login Now