Forums  ›  Cheetah  ›  Support
 

Default Profile Map problem

That is FANTASTIC information. A perfect fix! Thank you for taking the time and putting that together, Dean! I sincerely appreciate the effort. There is little information that is truly useless. Null island... Appropriately named being essentially "ground zero!"

And I look forward to your changes. 

Have a safe and happy New Years!

You may also want to note for future reference that i will be eventually replacing the google map module with something else that uses a free service, or at least one that allows it to be used, even limited without being forced to give them a credit card to make it work.

Not sure when google started doing it, but i can not get a working api key unless i fill out the billing information section in their API services which i am not going to do. I believe people that had obtained keys prior to that change have keys that still work. But i know new ones don't without billing info.

Actually, the exact location it's going to is called Null Island.  https://en.wikipedia.org/wiki/Null_Island

LOL. Yea i know, it's useless information. The map loads there by default because when a member has not set a location, the latitude and longitude coordinates are both 0, hence the reason the map goes to that location.

Anyhow, the module does not provide a way to set the default location. So you can make a edit to the code to do it. This code edit is for cheetah.

Edit modules\cheetah\world_map\classes\ChWmapModule.php

At about line 565 look for this code.

        $aVars = array(
            'msg_incorrect_google_key' => trim(_t('_ch_wmap_msg_incorrect_google_key')),
            'loading'                  => _t('_loading ...'),
            'map_control'              => getParam("ch_wmap_edit_{$sPart}_control_type"),
            'map_is_type_control'      => getParam("ch_wmap_edit_{$sPart}_is_type_control") == 'on' ? 1 : 0,
            'map_is_scale_control'     => getParam("ch_wmap_edit_{$sPart}_is_scale_control") == 'on' ? 1 : 0,

Add the following code just above that $aVars section...

        if($fLat == 0 && $fLng == 0) {
            $fLat = '42.6710';
            $fLng = '-72.5483';
            $iZoom = 6;
        }


Note: Replace the values in $fLat and $fLng with the latitude and longitude values of the actual location you want as the start location.

Some sites that you may look up locations on may actually use the terms North(N), South(S), East(E) and West(W). You need to use positive and negitive numbers in the code. So keep this is mind if you have to convert the numbers.

Positive latitude is above the equator (N), and negative latitude is below the equator (S). Positive longitude is east of the prime meridian, while negative longitude is west of the prime meridian.

In both Dolphin and Cheetah, I keep hitting a wall where the default map from which users select their location is showing off the coast of Africa (image included.)

I have my Google API in place, Cheetah recognizes it, and I've set my default locations in the World Map module, but still no joy.

Can someone kindly offer what I may be doing wrong, or a work around (if needed)... even if its manually editing the DB with the proper coordinates?


Thank you and happy New Year!! 

maperror.JPG88.7K3 views
Forums  ›  Cheetah  ›  Support