Skip to content

Commit

Permalink
simplified URL management in example
Browse files Browse the repository at this point in the history
Signed-off-by: Abel Vázquez Montoro <[email protected]>
  • Loading branch information
AbelVM committed Oct 28, 2024
1 parent 928cf11 commit d7b1ea7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ init(maplibregl);

const protocol = new pmtiles.Protocol();
maplibregl.addProtocol('pmtiles', protocol.tile);
const PMTILES_URL = (location.href.indexOf('index.html') == -1) ? location.href + 'assets/cotas.pmtiles' : location.href.replace('index.html', 'assets/cotas.pmtiles');
const PMTILES_URL = new URL('./assets/cotas.pmtiles', window.location.href).toString();
const p = new pmtiles.PMTiles(PMTILES_URL);
protocol.add(p);
p.getHeader().then(h => {
Expand Down

0 comments on commit d7b1ea7

Please sign in to comment.