-
Notifications
You must be signed in to change notification settings - Fork 1
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
d2002bf
commit d3c75bb
Showing
4 changed files
with
17 additions
and
55 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
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
<link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet" /> | ||
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script> | ||
<script src="https://unpkg.com/[email protected]/underscore-min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/flatgeobuf-geojson.min.js"></script> | ||
<script src="https://unpkg.com/json-formatter-js"></script> | ||
|
||
<style> | ||
|
@@ -46,8 +45,7 @@ | |
|
||
let httpReader = new wasm.HttpReader(input); | ||
console.log('httpReader', httpReader); | ||
// TODO: put in select_all? | ||
await httpReader.open(); | ||
console.log('bbox', bbox); | ||
let featureCollectionString = await httpReader.select_bbox(bbox.maxY, bbox.maxX, bbox.minY, bbox.minX); | ||
const featureCollection = JSON.parse(featureCollectionString); | ||
let i = 1; | ||
|
@@ -69,13 +67,6 @@ | |
maxZoom: 8, | ||
}); | ||
|
||
// optionally show some meta-data about the FGB file | ||
function handleHeaderMeta(headerMeta) { | ||
const header = document.getElementById("header") | ||
const formatter = new JSONFormatter(headerMeta, 10) | ||
header.appendChild(formatter.render()) | ||
} | ||
|
||
// get a rect around the map center | ||
function getBoundingBox() { | ||
const { lng, lat } = map.getCenter(); | ||
|
@@ -211,7 +202,7 @@ | |
}); | ||
</script> | ||
<p> | ||
FlatGeobuf's spatial index allows you to fetch the features that | ||
Geomedea's spatial index allows you to fetch the features that | ||
intersect a given bounding box, without downloading the entire file. | ||
This can be helpful when you have a very large file but are only | ||
interested in a small portion of it, and want to keep your page loads | ||
|
@@ -228,8 +219,5 @@ | |
they are much smaller because we fetch only the relevant sections of | ||
the file. | ||
</p> | ||
<div id="header"> | ||
<h3>Parsed header content</h3> | ||
</div> | ||
</body> | ||
</html> |
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
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