impress-org / google-maps-builder

One Google Maps plugin to rule them all. Google Maps Builder is intuitive, sleek, powerful and easy to use. Forget the rest, use the best.
https://wordpress.org/plugins/google-maps-builder/
32 stars 9 forks source link

Generate Coordinates from Address Fields in Existing Metadata #109

Open JustinSainton opened 9 years ago

JustinSainton commented 9 years ago

First off, OMG, I love you guys like a fat kid loves cake (I am both a fat kid, and I love cake, so I speak from a place of some authority on the matter).

So running into this issue on a project (I believe this may only apply to the Pro version). We have a couple hundred Custom Post Types with address information on them. They have no actual longitude/latitude information, which is a bummer.

I'm not sure if it would be within the scope of the Pro plugin to have a conversion tool in place that would generate the coordinates based on existing meta, but that would sure be handy. If it something you'd find useful, I'm happy to contribute what I'm building to get the job done.

kevinwhoffman commented 9 years ago

I think this is similar to #106. I'm looking forward to this feature, too. What seems tricky to me is making it flexible enough to handle posts with a single field for the entire address or multiple fields for street address, city, state, zip. Do you then select the field(s) in the Mashup Group like you do lat/lng?

@DevinWalker can you clarify how this might work?

JustinSainton commented 9 years ago

@kevinwhoffman Indeed, this is probably a dupe!

DevinWalker commented 9 years ago

@JustinSainton is your address data in a single or multiple meta keys?

First, we'll be supporting addresses in single fields since that's what Google expects when getting geocode results. Then up next is the option to select multiple address meta keys since I realize a lot of plugins (like EDD and ACF).

Then, we'll add support for outside data sources from APIs and more... but I'm getting ahead of myself here..

JustinSainton commented 9 years ago

@DevinWalker Multiple meta keys.

Sounds like y'all are on the right track :)

DevinWalker commented 9 years ago

Since we're collaborating over here let's just work from this one...

kevinwhoffman commented 9 years ago

You may already be aware but an ACF map field stores the location in a serialized array containing the street address, latitude and longitude in one meta_value. The unserialized version looks like this:

array(
  'address' => 'Street, City, State, Country',
  'lat' => '123',
  'lng' => '123',
)

Because of that format, ACF maps might require special attention, but I think it's also safe to assume if you have an ACF map value, you have the lat/lng values built in and don't need to worry about converting a street address.

DevinWalker commented 9 years ago

@kevinwhoffman is that built into the Pro version or standard? Also, there are LOT of possibilities with the various third-party Google Maps Add-ons.

kevinwhoffman commented 9 years ago

Google Map field is part of ACF standard and Pro. Just wanted to point out one example of a unique format. Originally I was only considering one string or multiple strings, but there are arrays to consider, too.

kevinwhoffman commented 8 years ago

@DevinWalker Given that ACF Google Map fields store lat/lng in an array within a single custom field, is there a way to generate a mashup map using posts that already have ACF map data? Or do I need to find a way to split that array into separate lat and lng fields so that the mashup markers are recognized?

kevinwhoffman commented 6 years ago

This is a valuable feature but we need a plan before beginning development. Moving this to Product Backlog for now.