Google just launched a new free API that will make it easier for developers to add civic information like polling places, early vote locations, candidate data and election official information to their applications. How can I add their new tool to my nation so people can use it to find a polling location?
Submitted
Official response from Matthew Pancione
Before getting started, make sure that you are using a custom theme. For directions on how to create one, visit our theme documentation.
1. From your control panel, go to Websites > Theme > layout.html and insert this tag between the <head> and </head> tags on your page:
<script type="text/javascript"src="https://voter-info-tool.appspot.com/js/loader.js"></script>
2. After you've added the code to your header, go to Websites > New page and create a new page using the basic template.
3. In the Template section of your new page, insert this code just beneath the {{ page.basic.content }} tag:
<div id="_vit"></div>
<script type="text/javascript">vit.load();</script>
</div>
Hit Save and you're done!
You can visit Google for more detailed documentation and customization info here, like setting up default regions and preloaded information.
Showing 1 reaction
Sign in with