Hello World Example
In this example you can see that we have done a few things:
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
html, body { margin: 0; padding: 0; height: 100%}
.dummy-header {
top: 0;
left: 0;
width: 100%;
height: 150px;
background-color: pink;
z-index: 1;
text-align: center;
line-height: 150px;
color: white;
font-size: 2em;
}
.dummy-footer {
position: relative;
background-color: gray;
height: 50vh;
width: 100%;
text-align: center;
line-height: 50vh;
color: white;
font-size: 2em;
}
#map {
z-index: 0;
height: calc(100vh - 150px);
width: 100%;
}
#wayfinder-map {
height: 100%;
}
</style>
</head>
<body>
<div id="wayfinder-map"></div>
</body>
<script src="<https://cdn.wayfinder.acquiredigital.com/live/js-api/wf.js>"></script>
<script type="text/javascript">
ACQ.init(document.getElementById("wayfinder-map"), {
apiKey: "XXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
})
</script>
</htm
In this example you can see that we have done a few things:
- Created a
divelement named "wayfinder-map" which will hold the Wayfinder map. - Imported the Wayfinder JS API using the script tag
- Called the function
ACQ.init()with some passed parameters which will load the required Wayfinder files.