19 posts by 9 authors in: Forums > CMS Builder
Last Post: September 16, 2010   (RSS)

By aev - March 26, 2010

Hi Dave,

can this plugin find the user location based on the browser IP, and then present a Google map with route description to a pre determined destination (our customer's location).

We are working on a site that could use this if possible.

-aev-

Re: [aev] Google Maps with Geocoding

By Dave - March 26, 2010

Hi aev,

No, there's no way to get the users location automatically that is guaranteed to work across multiple browsers.

The simplest is to ask them to enter their zip/postal code and lookup based on that.

Newer browser do have a way to prompt the use for their location:
http://www.google.ca/search?q=browser+geolocation+api

And you can use web services to get a location based on ip (accuracy varies anywhere from neighborhood level to country level based on the IP)
http://www.google.ca/search?q=ip+to+location

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

By aev - March 26, 2010

And you can use web services to get a location based on ip (accuracy varies anywhere from neighborhood level to country level based on the IP)
http://www.google.ca/search?q=ip+to+location


Can this be done without asking the user anything? Use the information if the browser supports these web services and just use a generic default if not, or maybe ask the user where they are..

Will your plugin support this? Built in?

-aev-

Re: [aev] Google Maps with Geocoding

By Dave - March 26, 2010

No, we don't have any plans to support those. The problem is they're not reliable enough, yet.

But yes, IP to Location can be done without asking the user anything. That's how they geotarget advertising. You won't know how accurate it is though, you could get their neighborhood or their country.
Dave Edis - Senior Developer
interactivetools.com

By Zicky - September 9, 2010

Dave,
Any word when the geocoding plugin will be available? Once it's available would the CMS user be able to enter an address and generate a map automatically from goggle so it would appear on the web site for the page it was enter into?

I can certainly use this, so real estate agents can load maps to properly listing addresses instantly through CMS Builder.

Re: [zickey] Google Maps with Geocoding

By Dave - September 13, 2010

Hi Zickey,

No ETA on this yet but we have a number of nearly finished plugins we need to release soon.

It doesn't show a map currently, it just lets them enter an address and it automatically geocodes it to lng/lat coordinates on save.

And it's not completely plug and play yet.. There's still a bit of code. But it does a lot of the work. We need some more demos and examples for it still.
Dave Edis - Senior Developer
interactivetools.com

Re: [InHouse] Google Maps with Geocoding

By Chris - September 15, 2010

Hi InHouse,

The geocoding plugin will take addresses (postal codes should work too) and turn them into (Lat,Lng) coordinates. That would be the first step in doing proximity searches.

A proximity search is basically accomplished by defining a "minimum bounding rectangle" of (Lat,Lng) coords around your centre point (to quickly cull very distant locations.) If the Earth were perfectly flat, this would be as simple as:

WHERE lat BETWEEN (<?php echo $record['lat'] - $dist ?> AND <?php echo $record['lat'] + $dist ?>) AND lng BETWEEN (<?php echo $record['lng'] - $dist ?> AND <?php echo $record['lng'] + $dist ?>)

For better precision, you'll need to adjust your longitude delta depending on the latitude (since 1° of lng decreases from 111km to 0km as you approach a pole.)

If you need to sort by distance and cull results which are farther than your max_dist (i.e. ones you caught with your rectangle but aren't in your circle,) you'll need to also use the Distance Formula (but for speed, skip the sqrt() part until you get your results back from MySQL.)

In short, it's somewhat complicated to do right. We may include examples with the plugin, and if not, we're available to help out through consulting, which should be quick because we've done this before. :)

I hope this helps!
All the best,
Chris

Re: [chris] Google Maps with Geocoding

Thanks Chris. Your commentary took me back to my undergrad days working with GIS transformations.

Looking forward to the new widget!

J.