Map not zooming

  • Harold
    Harold
    Newbie 19 points
    August 5, 2016 at 7:13 am

    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 );
    }


  • Josh
    Super Guru 13,875 points
    August 5, 2016 at 2:09 pm

    Hello Harold,
    Please go to Theme Setup >Content Setup >Geo Location and Google maps >Default Map Zoom (0-20) to change zoom

  • Harold
    Harold
    Newbie 19 points
    August 5, 2016 at 6:37 pm

    I have it set to 20. Still have the same issue. I do have an API key install. I used the Java script API. Is this the correct one. The video has not been updated to show that. It seems that others are having this issue. Also when i clck on the map no address shows up in the text box below

Viewing 3 posts - 1 through 3 (of 3 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes