Skip to content

Commit

Permalink
update to v3 protomaps
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Nov 11, 2022
1 parent f64d33a commit 781040b
Show file tree
Hide file tree
Showing 4 changed files with 3,007 additions and 1,184 deletions.
15 changes: 5 additions & 10 deletions cmd/example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@
var tile_url = document.body.getAttribute("data-protomaps-tile-url");

const map = L.map('map');
map.setView([37.61799, -122.370943], 14);

const p = new protomaps.PMTiles(tile_url);

p.metadata().then(m => {
let bounds_str = m.bounds.split(',')
let bounds = [[+bounds_str[1],+bounds_str[0]],[+bounds_str[3],+bounds_str[2]]]

var layer = protomaps.leafletLayer({url: tile_url, bounds:bounds});
layer.addTo(map);
map.fitBounds(bounds)
});
console.log(tile_url);

var layer = protomaps.leafletLayer({url:tile_url})
layer.addTo(map);

new L.Hash(map);
</script>
Expand Down
Binary file modified cmd/example/sfo.pmtiles
Binary file not shown.
Loading

0 comments on commit 781040b

Please sign in to comment.