-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f8b779
commit 7a30bea
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<html> | ||
<head> | ||
<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | ||
<script src="https://unpkg.com/[email protected]/dist/leaflet-src.js"></script> --> | ||
<meta charset="utf-8"> | ||
<script src='https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.js'></script> | ||
<link href='https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.css' rel='stylesheet' /> | ||
<script src="../src/L.Deflate.js"></script> | ||
<style> | ||
#map { | ||
position: absolute; | ||
top: 15px; | ||
left: 15px; | ||
bottom: 15px; | ||
right: 15px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<div id="map"></div> | ||
|
||
<script> | ||
|
||
window.onload = function () { | ||
L.mapbox.accessToken = 'pk.eyJ1Ijoib2xpdmVycm9pY2siLCJhIjoiY2phYTEyenM1MG02bTJxcTh0dHpmam1mNyJ9.wgmvIsRRvVSkj8_8z9yhUQ'; | ||
|
||
var map = L.map("map").setView([ | ||
51.50556382164291, | ||
-0.09128093719482422, | ||
], 12); | ||
|
||
var baselayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { | ||
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' | ||
}); | ||
baselayer.addTo(map); | ||
|
||
var features = L.deflate({minSize: 20, greedyCollapse: false}); | ||
features.addTo(map); | ||
|
||
L.polygon([ | ||
[51.503, -0.09], | ||
[51.509, -0.09], | ||
[51.509, -0.15], | ||
[51.503, -0.15], | ||
]).addTo(features); | ||
|
||
var features2 = L.deflate({minSize: 20, greedyCollapse: true}); | ||
features2.addTo(map); | ||
|
||
L.polygon([ | ||
[51.510, -0.06], | ||
[51.516, -0.06], | ||
[51.516, -0.12], | ||
[51.510, -0.12], | ||
]).addTo(features2); | ||
} | ||
</script> | ||
|
||
</html> |