bynomial
bynomial2w ago

lonboard map display

trying to display a map using lonboard. I don't get an error, but also don't get a map display. Does anyone have any experience with this? My understanding is that lonboard uses anywidget to output a jupyter widget, but I don't know.
5 Replies
Myles Scolnick
can you share a minimal example?
bynomial
bynomialOP2w ago
^ what is the best way for sharing an example? link to partial answer on anywidget server : https://discord.com/channels/1178781616714297576/1179097547235663972/1301960873664843861
Myles Scolnick
if you have a code snippet or marimo notebook, thanks!
bynomial
bynomialOP2w ago
Here is a snippet:
ddb.sql("create or replace table ncmap as select County,FIPS,County_ID,ST_Transform(geom,'EPSG:2264','EPSG:4326') as geometry from ST_Read('map/NC_State_County_Boundary_NCGS_2017.shp')")

sql = "SELECT County,FIPS,County_ID,ST_FlipCoordinates(geometry) as geometry FROM ncmap;"
query = ddb.sql(sql)
layer = PolygonLayer.from_duckdb(
query,
crs='EPSG:4326',
get_fill_color=[255, 255, 0],
)
m = Map(layer,_height=200)
type(layer)
mo.ui.anywidget(m)
ddb.sql("create or replace table ncmap as select County,FIPS,County_ID,ST_Transform(geom,'EPSG:2264','EPSG:4326') as geometry from ST_Read('map/NC_State_County_Boundary_NCGS_2017.shp')")

sql = "SELECT County,FIPS,County_ID,ST_FlipCoordinates(geometry) as geometry FROM ncmap;"
query = ddb.sql(sql)
layer = PolygonLayer.from_duckdb(
query,
crs='EPSG:4326',
get_fill_color=[255, 255, 0],
)
m = Map(layer,_height=200)
type(layer)
mo.ui.anywidget(m)
This is what it looks like in VSCode
No description
Myles Scolnick
Do you have a full runnable example?