Maps
These modular elements can be readily used and customized across pages and in different blocks.
Explore all of Stack's modular elements
at the
Element Index Page →
Iframe Map
Basic iframe maps can be embedded from maps.google.com. By default, the iframe map will span 100% the width of the container it is placed inside.
NOTE: Customizing the maps appearance is not available in the iframe embed.
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d402586.84704648267!2d144.77295768221077!3d-37.972234234374575!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad646b5d2ba4df7%3A0x4045675218ccd90!2sMelbourne+VIC!5e0!3m2!1sen!2sau!4v1472532711928" ></iframe>
Google Maps API
For a map with more style options, opt for the Google Maps API map. This map requires you to have your own developer API key from Google but opens up more attractive options for embedded maps.
There are a number of data attribute options to customise the behaviour of the map:
- data-maps-api-key="ApIKeYtExt1234" - Your Maps API Key, required to use a Google JS API map.
- data-address="123 Address Place, Townsville" - a simple text address acceptable by Google Maps with up to 10 addresses separated by semicolons.
- data-zoom-controls="RIGHT_BOTTOM" - Zoom controls can be positioned using any position listed in the Google Maps API Docs.
- data-map-zoom="NUM" - Sets zoom level between 1 and 12.
- data-map-style="JSON" - Apply any style from Snazzy Maps or make your own.
- data-marker-title="Title Text" - Text to appear when user hovers over map marker.
<div class="map-container" data-maps-api-key="AIzaSyCfo_V3gmpPm1WzJEC9p_sRbgvyVbiO83M" data-address="123 Rathdowne street, Carlton Victoria" data-marker-title="Stack"></div>
This is an overview. Explore the full docs ↗ for more.