Skip to content

Commit

Permalink
Upgrade leaflet in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Feb 12, 2020
1 parent cc459ab commit c0020e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This Leaflet plugin extends Leaflet with functions to encode to and decode from Google maps polyline encoding.

- Works with [Leaflet](https://github.com/Leaflet/Leaflet) v0.7.7 and v1.0.0-rc.1
- Works with [Leaflet](https://github.com/Leaflet/Leaflet) v0.7.7 and v1.x
- Algorithm described in the [Google maps API Documentation](https://developers.google.com/maps/documentation/utilities/polylinealgorithm).

## Escaping backslashes
Expand Down
6 changes: 3 additions & 3 deletions examples/decoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script>
</head>
<body>
<div id="map" style="width: 600px; height: 400px"></div>

<script src="../Polyline.encoded.js"></script>
<script>
var map = new L.Map('map');
var map = L.map('map');
L.tileLayer(
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{
Expand Down
11 changes: 6 additions & 5 deletions examples/encoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script>
</head>
<body>
<div id="map" style="width: 600px; height: 400px"></div>
<pre id="encoded" style= "width: 600px; height: 20px; padding: 10px; font-size: 20px;"><strong>Encoded:</strong> </pre>

<script src="../Polyline.encoded.js"></script>
<script>
var map = new L.Map('map');
var map = L.map('map');

L.tileLayer(
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
Expand All @@ -27,10 +27,11 @@
var latlngs = [
[38.5, -120.5],
[40.7, -120.95],
[43.252, -126.453]
[43.252, -126.453],
[45, -120]
];

var polyline = new L.Polyline(latlngs).addTo(map);
var polyline = L.polyline(latlngs).addTo(map);

map.fitBounds(polyline.getBounds());

Expand Down

0 comments on commit c0020e3

Please sign in to comment.