JSFiddle - React, Tailwind, and code Playground
by ghernandez27
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Get driving directions from one location to another</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.css' rel='stylesheet' />
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v2.3.0/mapbox-gl-geocoder.min.js'></script>
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v2.3.0/mapbox-gl-geocoder.css' type='text/css' />
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.0/mapbox-gl-draw.js'></script>
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.0/mapbox-gl-draw.css' type='text/css' />
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
height: 70%
}
</style>
</head>
<body>
<style>
.geocoder {
height: 100px;
width: 405px;
position: absolute;
top: 20px;
left: 10px;
background-color: rgba(255, 255, 255, .9);
padding: 15px;
text-align: left;
font-family: 'Arial';
margin: 0;
font-size: 13px;
}
#instructions {
position: absolute;
height: 100px;
margin: 10px;
width: 25%;
top: 80px;
bottom: 0;
padding: 20px;
background-color: rgba(255, 255, 255, 0.9);
overflow-y: scroll;
font-family: sans-serif;
}
</style>
<!-- the map -->
<div id='map'></div>
<!-- geocoder search input -->
<div class="geocoder">
<div id="geocoder"></div>
</div>
<!-- left side instructions -->
...