@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

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.012313080096703954","path":"index.html","file":{"path":"index.html","content":{"asEncoding":{"base64":"PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPlBvbHlsaW5lIG1hcHBlcjwvdGl0bGU+CiAgICA8IS0tIGluY2x1ZGUgTGVhZmxldCBsaWJyYXJpZXMgLS0+CiAgICA8bGluayByZWw9InN0eWxlc2hlZXQiIGhyZWY9Imh0dHBzOi8vdW5wa2cuY29tL2xlYWZsZXRAMS4zLjEvZGlzdC9sZWFmbGV0LmNzcyIvPgogICAgPHNjcmlwdCBzcmM9Imh0dHBzOi8vdW5wa2cuY29tL2xlYWZsZXRAMS4zLjEvZGlzdC9sZWFmbGV0LmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL3VucGtnLmNvbS9wb2x5bGluZUAwLjIuMC9zcmMvcG9seWxpbmUuanMiPjwvc2NyaXB0PgogIDwvaGVhZD4KICA8Ym9keT4KICAgIDxiPlBvbHlsaW5lOjwvYj4KICAgIDxkaXY+CiAgICAgICAgPGlucHV0IHR5cGU9ImNoZWNrYm94IiBpZD0idW5lc2NhcGVkIiAvPgogICAgICAgIDxsYWJlbCBmb3I9InVuZXNjYXBlZCI+VW5lc2NhcGVkPC9sYWJlbD4KICAgIDwvZGl2PgogICAgPGRpdj48dGV4dGFyZWEgaWQ9InBvbHlsaW5lIiBjb2xzPSI4MCIgcm93cz0iNSI+PC90ZXh0YXJlYT48L2Rpdj4KICAgIDxkaXYgaWQ9Im1hcCIgc3R5bGU9ImhlaWdodDo1MDBweDsgd2lkdGg6NzAwcHg7IG1hcmdpbi10b3A6IDEwcHg7Ii8+CiAgICA8c2NyaXB0IHNyYz0iaW5kZXguanMiPjwvc2NyaXB0PgogIDwvYm9keT4KPC9odG1sPg=="},"asBuffer":null},"loaded":true}}
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