Skip to content

Commit

Permalink
js 2.0.2 (#141)
Browse files Browse the repository at this point in the history
* js 3.0.0

* bump PMTiles to v3, don't export bundled one (you shouldn't be using it)
* add examples for PMTiles custom headers [#114]
* es6 default
* remove unused bezier curves
* change es6 output from .module.js to index.js
  • Loading branch information
bdon committed Feb 25, 2024
1 parent a298e73 commit 908001f
Show file tree
Hide file tree
Showing 18 changed files with 792 additions and 182 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 3.0.0

* Unexport `PMTiles` because you shouldn't be depending on the one bundled in this library.
* Bump `pmtiles` dependency to v3.x
* package.json defaults to ES6.
* remove CubicBezier function as no longer used.

# 2.0.0

Major version 2.0 aggressively reduces the scope of this rendering library.
Expand Down
2 changes: 1 addition & 1 deletion benchmark/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="pixelmatch.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
html {
Expand Down
2 changes: 1 addition & 1 deletion examples/comparison.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@maplibre/maplibre-gl-leaflet@0.0.20/leaflet-maplibre-gl.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<style>
#parent {
display:flex;
Expand Down
2 changes: 1 addition & 1 deletion examples/fonts.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet-hash@0.2.1/leaflet-hash.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->

<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Work+Sans:wght@100..900&family=Petrona:wght@100..900&family=Raleway:wght@100..900" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion examples/inset.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
#map {
Expand Down
2 changes: 1 addition & 1 deletion examples/labels.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet-hash@0.2.1/leaflet-hash.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
body, #map {
Expand Down
2 changes: 1 addition & 1 deletion examples/leaflet.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet-hash@0.2.1/leaflet-hash.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
body, #map {
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet-hash@0.2.1/leaflet-hash.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
body, #map {
Expand Down
25 changes: 25 additions & 0 deletions examples/pmtiles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
body, #map {
height:100vh;
margin:0px;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
const map = L.map('map')
var layer = protomapsL.leafletLayer({url:'https://data.source.coop/protomaps/openstreetmap/tiles/v3.pmtiles',theme:'black'})
map.setView(new L.LatLng(0,0),0)
layer.addTo(map)
</script>
</body>
</html>
30 changes: 30 additions & 0 deletions examples/pmtiles_headers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/pmtiles@3.0.3/dist/pmtiles.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
body, #map {
height:100vh;
margin:0px;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
const map = L.map('map')

const source = new pmtiles.FetchSource("https://data.source.coop/protomaps/openstreetmap/tiles/v3.pmtiles", {"x-custom-header":"value"});

const p = new pmtiles.PMTiles(source)
var layer = protomapsL.leafletLayer({url:p,theme:'black'})
map.setView(new L.LatLng(0,0),0)
layer.addTo(map)
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/sandwich.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet-hash@0.2.1/leaflet-hash.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
body, #map {
Expand Down
2 changes: 1 addition & 1 deletion examples/sprites.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet-hash@0.2.1/leaflet-hash.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
body, #map {
Expand Down
2 changes: 1 addition & 1 deletion examples/static.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/protomaps-leaflet@2.0.1/dist/protomaps-leaflet.min.js"></script>
<script src="https://unpkg.com/protomaps-leaflet@3.0.0/dist/protomaps-leaflet.min.js"></script>
<!-- <script src="../dist/protomaps-leaflet.js"></script> -->
<style>
#map {
Expand Down
Loading

0 comments on commit 908001f

Please sign in to comment.