repl.it
@digitransit/

Polyline_Decode_Map

HTML, CSS, JS

Plan an itinerary and display 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
<!doctype html>
<html>
  <head>
    <title>Polyline decode</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>
    <p>Right-click on the map to set origin and destination points</p>
    <div id="map" style="height:500px; width:700px;"/>

    <script src="index.js"></script>
  </body>
</html>
result
console