Coordinates not found

Questions and answers about change of functions, design, hosting etc.

Moderators: Koduc, Xpycm

Forum rules
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

Coordinates not found

Postby Batman93 » 15 Oct 2018, 17:19

Since a few days, as I add a new listing, and use the "Map", I always have "Coordinates not found" reported using "Set a market by address" option.

The map is displayed.
That issue is new, I never had that issue before.
I use the V20 and the API key is ok.

Thanks !
Batman93
Stranger
 
Posts: 19
Joined: 06 May 2017, 23:13
Reputation point: 0

Re: Coordinates not found

Postby jmclement » 16 Oct 2018, 12:28

Same here *WALL*
jmclement
Stranger
 
Posts: 13
Joined: 27 Nov 2017, 13:45
Reputation point: 0

Re: Coordinates not found

Postby jmclement » 17 Oct 2018, 19:41

No answer??? Client is bored...
jmclement
Stranger
 
Posts: 13
Joined: 27 Nov 2017, 13:45
Reputation point: 0

Re: Coordinates not found

Postby Batman93 » 17 Oct 2018, 20:39

Very disapointing that Monoray app... and their service.
They sell you something, change the versions, some code is obsolete after 1 year, then it fails and they don't respond...
Batman93
Stranger
 
Posts: 19
Joined: 06 May 2017, 23:13
Reputation point: 0

Re: Coordinates not found

Postby andipas » 17 Oct 2018, 21:58

Sorry. Such a problem appeared in earlier versions, because API google map changed.
We answer all questions, please write to us on skype: monoray.studio or email: support@monoray.net

Online Hours by Moscow Time:

9:00am - 5:00pm (UTC/GMT +3 hours) Monday through Friday
andipas
Web Developer
Web Developer
 
Posts: 156
Joined: 28 Dec 2011, 22:37
Reputation point: 1

Re: Coordinates not found

Postby andipas » 17 Oct 2018, 22:22

To fix this, in the file protected/components/Geocoding.php

replace
Code: Select all

    static function getCoordsByAddress
($address, $city = null, $useGoogle = false)
    {
        $return = array();
        if (param('useGoogleMap', 1) || $useGoogle) {
            if ($city !== null) {
                $result = self::getGeocodingInfoJsonGoogle($city, $address);
            } else {
                $result = self::getGeocodingInfoJsonGoogle(param('defaultCity', 'Москва'), $address, param('module_apartments_gmapsCenterX', 37.620717508911184), param('module_apartments_gmapsCenterY', 55.75411314653655), param('module_apartments_gmapsSpanX', 0.552069), param('module_apartments_gmapsSpanY', 0.400552));
            }
            if (isset($result->results[0])) {
                if (isset($result->results[0]->geometry->location)) {
                    $return['lat'] = $result->results[0]->geometry->location->lat;
                    $return['lng'] = $result->results[0]->geometry->location->lng;
                }
            }
        } elseif (param('useYandexMap', 1)) {
            if ($city !== null) {
                $result = self::getGeocodingInfoJsonYandex($city, $address);
            } else {
                $result = self::getGeocodingInfoJsonYandex(param('defaultCity', 'Москва'), $address, param('module_apartments_ymapsCenterX', 37.620717508911184), param('module_apartments_ymapsCenterY', 55.75411314653655), param('module_apartments_ymapsSpanX', 0.552069), param('module_apartments_ymapsSpanY', 0.400552));
            }

            if (isset($result->response->GeoObjectCollection->featureMember[0])) {
                if (isset($result->response->GeoObjectCollection->featureMember[0]->GeoObject->Point->pos)) {
                    $pos = explode(' ', $result->response->GeoObjectCollection->featureMember[0]->GeoObject->Point->pos);
                    $return['lat'] = $pos[1];
                    $return['lng'] = $pos[0];
                    ;
                }
            }
        } elseif (param('useOSMMap', 1)) {
            if ($city !== null) {
                $result = self::getGeocodingInfoJsonOSM($city, $address);
            } else {
                $result = self::getGeocodingInfoJsonOSM(param('defaultCity', 'Москва'), $address);
            }

            if (isset($result[0])) {
                if (isset($result[0]->lat)) {
                    $return['lat'] = $result[0]->lat;
                    $return['lng'] = $result[0]->lon;
                }
            }
        }

        return $return;
    }


on
Code: Select all

static function getCoordsByAddress
($address, $city = null, $useGoogle = false)
    {
        $return = array();
        if (param('useGoogleMap', 1) || $useGoogle) {
            if ($city !== null) {
                $result = self::getGeocodingInfoJsonGoogle($city, $address);
            } else {
                $result = self::getGeocodingInfoJsonGoogle(param('defaultCity', 'Москва'), $address, param('module_apartments_gmapsCenterX', 37.620717508911184), param('module_apartments_gmapsCenterY', 55.75411314653655), param('module_apartments_gmapsSpanX', 0.552069), param('module_apartments_gmapsSpanY', 0.400552));
            }
            if (isset($result->results[0])) {
                if (isset($result->results[0]->geometry->location)) {
                    $return['lat'] = $result->results[0]->geometry->location->lat;
                    $return['lng'] = $result->results[0]->geometry->location->lng;
                }
            }
        }

        if ((param('useGoogleMap', 1) && !$return) || param('useOSMMap', 1)) {
            if ($city !== null) {
                $result = self::getGeocodingInfoJsonOSM($city, $address);
            } else {
                $result = self::getGeocodingInfoJsonOSM(param('defaultCity', 'Москва'), $address);
            }

            if (isset($result[0])) {
                if (isset($result[0]->lat)) {
                    $return['lat'] = $result[0]->lat;
                    $return['lng'] = $result[0]->lon;
                }
            }
        }

        if ((param('useGoogleMap', 1) && !$return) || param('useYandexMap', 1)) {
            if ($city !== null) {
                $result = self::getGeocodingInfoJsonYandex($city, $address);
            } else {
                $result = self::getGeocodingInfoJsonYandex(param('defaultCity', 'Москва'), $address, param('module_apartments_ymapsCenterX', 37.620717508911184), param('module_apartments_ymapsCenterY', 55.75411314653655), param('module_apartments_ymapsSpanX', 0.552069), param('module_apartments_ymapsSpanY', 0.400552));
            }

            if (isset($result->response->GeoObjectCollection->featureMember[0])) {
                if (isset($result->response->GeoObjectCollection->featureMember[0]->GeoObject->Point->pos)) {
                    $pos = explode(' ', $result->response->GeoObjectCollection->featureMember[0]->GeoObject->Point->pos);
                    $return['lat'] = $pos[1];
                    $return['lng'] = $pos[0];
                }
            }
        }


        return $return;
    }
andipas
Web Developer
Web Developer
 
Posts: 156
Joined: 28 Dec 2011, 22:37
Reputation point: 1

Re: Coordinates not found

Postby jmclement » 18 Oct 2018, 16:11

Thank you andipas, this fix worked.
jmclement
Stranger
 
Posts: 13
Joined: 27 Nov 2017, 13:45
Reputation point: 0

Re: Coordinates not found

Postby support » 18 Oct 2018, 16:56

Hello!

The code may become outdated in a year, because third-party services change, monetize, disable API. Especially Google Maps. No another way. Hostings update their software. And a lot of things may happen for that time not because of developers or a script fault. Technical support costs monthly extra pay, but we give answers and help years after the purchase and the end of the support period. Developers are busy, that's why the answer may be given a little later than you expect yourself.

P.S:
Current Forum Rules:
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

P.S.S:
Support Terms: https://open-real-estate.info/en/techni ... port-rules

P.S.S.S:
Support Plans: https://open-real-estate.info/en/techni ... port-plans
support
Citizen
Citizen
 
Posts: 136
Joined: 28 Dec 2011, 13:14
Reputation point: 0

Re: Coordinates not found

Postby Batman93 » 19 Oct 2018, 20:18

Worked, thanks.
That kind of information should be available to your clients, even after 1 year.
Batman93
Stranger
 
Posts: 19
Joined: 06 May 2017, 23:13
Reputation point: 0


Return to Questions and help for changes

Who is online

Users browsing this forum: No registered users and 11 guests

cron