Setting Up Our Website — Multiple Markers on Google Maps with Wix Velo
Map data adds incredible richness to our websites. Ep 1 helps us to set up our website for the rest of the series.
Map data adds incredible richness to our websites. Ep 1 helps us to set up our website for the rest of the series.
Integration with map data has never been more important for businesses and users. As our systems become ever more connected, the contextualisation of information in terms of location provides incredible value to businesses.
One method to integrate this is displaying locations on a map. This might be static locations like the site(s) your business runs from, or maybe the location of your pop-up store. For these types of applications, Wix has a wonderful element which can be dragged and dropped right into your website. Here’s the link to their excellent tutorial.
A far more complex implementation is the addition of dynamic and changing locations to the map. This could be incredibly useful for dynamically updating the location of your delivery drivers, or in my case, displaying an audit trail for a security seal. It involves a series of coding efforts, the addition of an HTML element, and connecting to a database collection.
The Wix provided tutorial is pretty good, however, I felt that an in-depth, step-by-step tutorial would add a lot of value. So here it is.
Enjoy ❤️
Our goal in this series is to build a website which fully integrates the display of multiple, dynamic map data points into a Google Maps display. We want to be able to update a location and have it almost immediately display on our website. If you’d like to read more about why this is important, here’s my introduction.
Working Example: The example we’ll be using is shown here.
Github / Code Repo: For those who find it useful, the public github repo is here.
Along the way, I’ll share couple of tips on some security considerations, along with helpful observations which will hopefully save you many hours of troubleshooting. The full list of episodes can be found at the bottom of each episode.
As always, I hope this content is helpful. It means the absolute world to me when you take time to clap for an episode, subscribe to my stories or use my referral link to sign up for Medium. It lets me know that my stories are helping you ❤️.
Enjoy, and feel free to drop me a DM on twitter, connect on LinkedIn / Github with thoughts and comments 😃
In this episode, we’ll be covering the initial setup of the project. If you’ve got experience with the Wix Editor, hopefully this is pretty straight-forward. There’s no code required in this section, and if you have it already set up, you can simply skip it.
We’ll be covering the following:
Let’s do it!
As you can see in the demo, our page design is a simple Title, Map and Wix Form. All these elements can be added from the Wix Editor.
To start with, set up the following using the Wix Editor:
googleMapsFrame
, and we’ll be using it in Episode 4wixForm1
— as we’ll use it in Episode 5A few notes on security as we get started.
With our page designed, it’s time to setup the database collection. For our particular example, we want the data to be accessible to any person who browses to this page.
Your specific implementation might be different, and it is always best practice to review this before implementation. It will save you time wasted when your code stops working due to an access error, and a lot of heartache if private data is exposed through incorrect permissions setups.
In Wix, this is as simple as going to the collection and changing the access, so do this now.
While you’re there, make note of the following. These names and ID’s are case sensitive:
For mine, I didn’t do a lot of configuration, so I got some pretty generic ones. Here are mine:
Once done, hit ‘Publish’ on the Wix Editor.
Now it’s time for us to add some locations. How exciting!
Go through and add in at least 10 locations. Take note while you’re doing so that the form works as expected.
If you’re looking for some inspiration, here’s a list of the 10 I started with. They’re all around the beautiful city of Sydney, Australia, a place where I used to live.
The final step is to check your database collection. Make sure that the entries from your form have gone into the collection and that you have at least 10 entries there.
That’s basically it for Episode 1. We’ve achieved the following:
With our website look and feel completed, we’re ready to start getting our locations ready to display. I can’t wait!!!
The full list of episodes in this series are linked below to help you navigate quickly ❤