Page 1 of 1

Coordinates not found

PostPosted: 15 Oct 2018, 17:19
by Batman93
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 !

Re: Coordinates not found

PostPosted: 16 Oct 2018, 12:28
by jmclement
Same here *WALL*

Re: Coordinates not found

PostPosted: 17 Oct 2018, 19:41
by jmclement
No answer??? Client is bored...

Re: Coordinates not found

PostPosted: 17 Oct 2018, 20:39
by Batman93
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...

Re: Coordinates not found

PostPosted: 17 Oct 2018, 21:58
by andipas
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

Re: Coordinates not found

PostPosted: 17 Oct 2018, 22:22
by andipas
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;
    }

Re: Coordinates not found

PostPosted: 18 Oct 2018, 16:11
by jmclement
Thank you andipas, this fix worked.

Re: Coordinates not found

PostPosted: 18 Oct 2018, 16:56
by support
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

Re: Coordinates not found

PostPosted: 19 Oct 2018, 20:18
by Batman93
Worked, thanks.
That kind of information should be available to your clients, even after 1 year.