Auto populate Latitude & Longitude using postcode

Permalink Browser Info Environment
Is it possible to automatically assign values to Latitude & Longitude by entering the address details?

Type: Discussion
Status: New
hudsonarmstrong
View Replies:
Tony replied on at Permalink Reply
Tony
yeah, that happens automatically with the real estate add-ons through a google service call. the latitude and longitude are entered as page attributes. you can clear those fields if you need it to be refreshed.
hudsonarmstrong replied on at Permalink Reply
hudsonarmstrong
Hi Tony,

Thanks for feedback. I've discussed the issue with a colleague and can confirm that the map previously automatically positioned the map. However this has now stopped? No settings have been changed but the functionality simply stopped working.

Any help you can provide would be welcome, many thanks.
Tony replied on at Permalink Reply
Tony
if you edit the page attributes, and set both the longtitude and latitude to zero, then refresh the page, do those values get updated? (i should actually make an improvement here on how those are refreshed) are you sure you have a valid address? are you sure you have a good internet connection so your local server can hit that google service?
hudsonarmstrong replied on at Permalink Reply
hudsonarmstrong
Hi Tony,

Both longtitude and latitude are set to zero but refreshing the page has no effect. The website is hosted on a dedicated server so should be quick. The addresses were previously working with the auto map placement so I know that they are correct.

If you would like to view the site and admin please let me know. Many thanks.
hudsonarmstrong replied on at Permalink Reply
hudsonarmstrong
Reviewing the added properties I can see that the auto longtitude/latitude values were populated successfully before the 26th Feb. All properties entered there after failed to auto generate any longtitude/latitude values. Has something changed with Google API ?
Tony replied on at Permalink Reply
Tony
It's possible that the api changed, although google tends to do a good job at preserving backwards compatibility. will test it out for you when I get a chance, possibly tonight.
Tony replied on at Permalink Reply
Tony
well this is a pain. google made a change last year where the geolocation API key was no longer required, so I disabled the warning when users don't have a key defined. but it looks like they now require the API again. seems like they're going to start charging for more of these free services. there is a developer agreement where you're allowed to have up to 100 requests per day though, so I imagine on a package like this you're not going to exceed that threshold unless you're hooking into some MLS service to pull in tons of listings.

anyway, to get your key go here to see the details:
https://developers.google.com/maps/documentation/business/geolocatio...

...and then you'll want to enter your key like this within /config/site.php:
define('GOOGLE_MAPS_API_KEY', 'your_key_string_goes_here');

if that doesn't work for you then I may have to update the geolocation calls to use their version 3 API, so let me know if that doesn't work for you. I'm still using my old version 2 keys and it seems to work

thanks - Tony
hudsonarmstrong replied on at Permalink Reply
hudsonarmstrong
Hi Tony, the address field auto populates the Long/latitude info but when visiting the public side Google shows a warning message.

Example:http://bb.hadev.co.uk/index.php/west-cornwall/redruth/white-alice-f...
Tony replied on at Permalink Reply
Tony
ok, it looks like I'm going to have to update the package to use a newer version of their API. please give me a few days to work on this and I'll get you an updated package.
Tony replied on at Permalink Reply
Tony
ok, I've updated the google maps and geocode api calls to use the latest versions. try updating to version 2.12 and let me know if your still seeing this issue
hudsonarmstrong replied on at Permalink Reply
hudsonarmstrong
Hi Tony,

When I try to upgrade I receive the following error message:

Fatal error: Call to a member function getAreaBlocksArray() on a non-object in /var/www/vhosts/hadev.co.uk/bb/packages/tony_real_estate/controller.php on line 498
Tony replied on at Permalink Reply
Tony
It may be trying to find grab the blocks from an area that doesn't exist. Most people have areas within their themes named Main and Sidebar, but if you don't have areas with those names you can rename them to something else by adding these global variable definitions within your /config/site.php file:

define('REAL_ESTATE_LIST_MAIN_AREA_NAME','Main');
define('REAL_ESTATE_LIST_MAIN_AREA_NAME','Sidebar')

....substituting Main and Sidebar for the area names within your theme, and then uninstalling and reinstalling the package. Let me know if that fixes the issue for you. I'll try to make the package handle that situation better so that the user is notified what the issue is if they don't have those areas defined. thanks
waynemoore replied on at Permalink Reply
waynemoore
I followed these steps and generated a server based api key and added it to the config file.

I've reverted back and forth between google maps v2 & v3. Still not getting any map action. Is there something i'm missing?

Here is the site i'm looking at. (note that if you visit the home link in the nav, you will be taken to a form that is skinned differently; you will need to use your browsers back button to re-access this page).

Thank you for your support.
Tony replied on at Permalink Reply
Tony
hey Wayne, since you asked for help in three different locations I'm just going to respond to your support thread here:http://www.concrete5.org/marketplace/addons/real-estate/support-and...

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.