Home › Forums › Welcome! › Pre-Sales Questions › Calendar Location Functionality
- This topic has 4 replies, 2 voices, and was last updated 9 years, 7 months ago by
Support Droid.
-
AuthorPosts
-
August 31, 2016 at 12:47 pm #1158443
WSi
GuestHello,
We have a client that needs geo location functionality in a few areas of their website. For example, Events, Office Locations, etc. I don’t want to build in two different GEO solutions so I was hoping somehow I could harness the geolocation from the calendar to other post types.
Looking forward to your thoughts and thanks in advance.
August 31, 2016 at 11:22 pm #1158592Brook
ParticipantHowdy WSi,
I would love to help you with this. You could certainly as much our API as is convenient. You could store everything as venues, then use the Google Maps scripts with our plugin to show them as maps. Or you just use our Google Maps scripts, if storing them as venues does not make sense for some reason.
Geolocation is so trivially simple with Google Maps. You provide an address or lat/lng and they will give you the map. Google will be the one doing most of the work for you here. You just need to store the address or coordinates somewhere. You could do it as a venue, or it might make more sense doing it a custom field on one of the other post types.
The main thing you would probably want to share would be the Google maps script, which you can configure an API key for and everything from our admin. Just enqueue it where you need and then craft your map query.
Does that all make sense? In brief, you can basically use as much of our API as you want if it will make your job easier. How much I’d recommend using will depend on the job.
Cheers!
– Brook
September 1, 2016 at 11:12 am #1158937WSi
GuestHey Brook,
Thank you very much for your response and willingness to help.
– How would I just use your Google Map scripts for other post types that aren’t Venues?
– Would I still be able to take advantage of the filters?
– Would AJAX still work?
– Should I be concerned about the amount of requests we’ll be making?Thanks again in advance. I’m pretty sure this solution we’ll work.
September 2, 2016 at 5:09 am #1159195Brook
ParticipantYou are welcome!
How would I just use your Google Map scripts for other post types that aren’t Venues?
When I am talking about the Google Maps Script I am literally talking about just the script. It will be a URL like: https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap And it will load that JavaScript file on your site allowing you to do geolocation using Google Maps.
So you will enqueue that script using our API on any page you need it on (regardless of post type), and now you can do anything Google Maps allows.
Would I still be able to take advantage of the filters?
You could still use the handful of filters that are called when we load Google Maps, but there is not many of them and you likely will not have need for any of them. Loading Google Maps is a very simple thing to do.
Would AJAX still work?
The Google Maps Ajax will all be handled by theit script. If the code your writing is compatible with Google Maps any Ajax you are doing will work fine.
Should I be concerned about the amount of requests we’ll be making?
Yes. The link above that I shared has a lot more details on Google Maps itself. If you run a high traffic site with thousands of visitors a day then you might need to purchase a plan from Google.
In brief, basically every single thing you are trying to do will be handled by the stock Google Maps script our plugin can load on your behalf. From there your site can do anything Google Maps allows, and you will need to consult their documentation to figure out the hows and whats.
Maps are ultimately super simple, and so if you are storing your geo data in a different post type and format than our venues, then you have already effectively duplicated everything our plugin does with venues only elsewhere. At that point all you will need to do is load the JS script (which you could use our plugin to do) and start doing stuff with Google Maps and your data.
Hopefully that is starting to make more sense. Please let me know.
Cheers!
– Brook
September 24, 2016 at 9:35 am #1168302Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Calendar Location Functionality’ is closed to new replies.
