Jump to content

Using MapMarker data for Google Maps Store-Locator.js?


Recommended Posts

Hey folks, I'm looking to implement the Google Maps Store Locator library to create a "Find Locations Near You" page for my site.

I'm using the MapMarker fieldtype to create my locations, but I'm not sure how to connect my location data to the storeLocator.DataFeed

The examples provided for the Store locator fetch data from static CSV files or web services. Any thoughts on how to hook things up?

Thanks so much!

Link to comment
Share on other sites

You've essentially two options. Either use a dedicated page to generate a json or csv output, which you can call from your javascript. Or you can just output the data as json directly to the page you're using the Store Locator on, like this:

echo "<script type='text/javascript'>var storelocator_data=".json_encode($yourData).";</script>"
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...