Being able to show information about games before they happen is great. But what about if you could show a Google Map to show where the game is taking place?
With Sports Bench, you can do that.
The following steps will help you be able to display a map to the stadium that will display wherever the game preview is shown (sidebar, shortcode and Gutenberg block).
Getting a Google Maps API key
So the first thing you need to do to get maps to show for games is to get a Google Maps API key. It’s an unfortunate step for something so simple, but it’s not too hard to accomplish.
You can start the process of getting an API key with this guide. It takes all of a couple of steps to take care of. And don’t worry if you see the word payment anywhere. The Maps API key is free unless it sees an ungodly amount of traffic.
Adding the key to Sports Bench
Once you have your Google Maps API key, getting it into Sports Bench is pretty easy. You’ll simply navigate to the Sports Bench settings page. Then add the key where it says “Google Maps API Key”. You will also want to make sure the checkbox for the “Display Google Map with Game Location in Preview” option is checked.
Once you’re done with both of those things, you’re ready to start adding the maps to games.
Getting the map to show in games
Now that you have your API key and it’s inserted into the Sports Bench options, it’s time to make the maps appear on the game previews. Fortunately, this is pretty easy. First, you want to make sure an address is entered for each team in the league. Then when you create a new game, the home team’s address will be added to the game’s address. If you’ve already created a game, go in and hit save. This will add the home team’s address to the game.
If the game is a neutral site game, check that checkbox when creating the game. A new line of fields will appear where you can enter the address for the game.
Then when you go to the game preview or create a game preview shortcode or block for the game, the Google Map for the stadium will show. And now everyone will know how to get to the game.