elivz / VzAddress-Craft

Address fieldtype for the Craft CMS
30 stars 13 forks source link

Functionality for dynamic Google Maps #21

Closed englishtom closed 7 years ago

englishtom commented 7 years ago

Hi Eli,

I've added two new methods to the Model; the first takes a string and queries the Google geocode API and returns a lat/lng pair if it is able. The second method is equivalent to staticMap but it is dynamicMap and returns the relevant markup & javascript to render a javascript Google Map with the map pin pointed at the geocoded lat/lng from the address string entered in the admin field.

I also added documentation for the new public method and I changed the 'style' parameter on staticMap to 'styles' so that it's consistent between dynamicMap and staticMap.

Cheers,

Tom

elivz commented 7 years ago

Finally had a chance to get this merged in. Sorry for the delay, and thanks for the contribution!