FlatGeobuf Layer¶
This notebook demonstrates how to load and display FlatGeobuf files on MapLibre maps. FlatGeobuf is a cloud-native vector format that supports streaming reads.
In [ ]:
Copied!
# %pip install anymap-ts
# %pip install anymap-ts
Load FlatGeobuf from URL¶
In [ ]:
Copied!
from anymap_ts import Map
m = Map(center=[-100, 40], zoom=4)
m.add_flatgeobuf(
"https://flatgeobuf.org/test/data/UScounties.fgb",
name="counties",
)
m
from anymap_ts import Map
m = Map(center=[-100, 40], zoom=4)
m.add_flatgeobuf(
"https://flatgeobuf.org/test/data/UScounties.fgb",
name="counties",
)
m
Custom Styling¶
In [ ]:
Copied!
m2 = Map(center=[-100, 40], zoom=4)
m2.add_flatgeobuf(
"https://flatgeobuf.org/test/data/UScounties.fgb",
name="counties-styled",
paint={
"fill-color": "#088",
"fill-opacity": 0.4,
"fill-outline-color": "#333",
},
)
m2
m2 = Map(center=[-100, 40], zoom=4)
m2.add_flatgeobuf(
"https://flatgeobuf.org/test/data/UScounties.fgb",
name="counties-styled",
paint={
"fill-color": "#088",
"fill-opacity": 0.4,
"fill-outline-color": "#333",
},
)
m2
Remove FlatGeobuf Layer¶
In [ ]:
Copied!
m.remove_flatgeobuf("counties")
m.remove_flatgeobuf("counties")