repl.it
@digitransit/

Polyline Mapper

HTML, CSS, JS

Decodes a Google encoded polyline and displays it on a map

fork
loading
Files
  • index.html
  • index.css
  • index.js
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
  <head>
    <title>Polyline mapper</title>
    <!-- include Leaflet libraries -->
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"/>
    <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
    <script src="https://unpkg.com/[email protected]/src/polyline.js"></script>
  </head>
  <body>
    <b>Polyline:</b>
    <div>
        <input type="checkbox" id="unescaped" />
        <label for="unescaped">Unescaped</label>
    </div>
    <div><textarea id="polyline" cols="80" rows="5"></textarea></div>
    <div id="map" style="height:500px; width:700px; margin-top: 10px;"/>
    <script src="index.js"></script>
  </body>
</html>
result
console