Skip to content

Commit

Permalink
attempt at map attribution (#76)
Browse files Browse the repository at this point in the history
* attempt at map attribution

* can see attribution!

* Add _css property to anywidget

* include css in wheel

---------

Co-authored-by: Vitor George <[email protected]>
  • Loading branch information
kylebarron and vgeorge authored Oct 20, 2023
1 parent 3dd7924 commit 6830734
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lonboard/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class ScatterplotLayer(BaseLayer):
"""

_esm = bundler_output_dir / "scatterplot-layer.js"
_css = bundler_output_dir / "scatterplot-layer.css"
_layer_type = traitlets.Unicode("scatterplot").tag(sync=True)
_initial_view_state = traitlets.Dict().tag(sync=True)

Expand Down Expand Up @@ -296,6 +297,7 @@ class PathLayer(BaseLayer):
"""

_esm = bundler_output_dir / "path-layer.js"
_css = bundler_output_dir / "path-layer.css"
_layer_type = traitlets.Unicode("path").tag(sync=True)
_initial_view_state = traitlets.Dict().tag(sync=True)

Expand Down Expand Up @@ -454,6 +456,7 @@ class SolidPolygonLayer(BaseLayer):
"""

_esm = bundler_output_dir / "solid-polygon-layer.js"
_css = bundler_output_dir / "solid-polygon-layer.css"
_layer_type = traitlets.Unicode("solid-polygon").tag(sync=True)
_initial_view_state = traitlets.Dict().tag(sync=True)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Kyle Barron <[email protected]>"]
license = "MIT"
readme = "README.md"
packages = [{ include = "lonboard" }]
include = ["lonboard/static/*.js"]
include = ["lonboard/static/*.js", "lonboard/static/*.css"]

[tool.poetry.dependencies]
python = "^3.8"
Expand Down
3 changes: 3 additions & 0 deletions src/path-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { GeoArrowPathLayer } from "@geoarrow/deck.gl-layers";
import { useParquetWasm } from "./parquet";
import { useAccessorState, useTableBufferState } from "./accessor";

import "maplibre-gl/dist/maplibre-gl.css";

const DEFAULT_INITIAL_VIEW_STATE = {
latitude: 10,
longitude: 0,
Expand Down Expand Up @@ -70,6 +72,7 @@ function App() {
}
controller={true}
layers={layers}
height={300}
// ContextProvider={MapContext.Provider}
>
<Map mapStyle={MAP_STYLE} />
Expand Down
3 changes: 2 additions & 1 deletion src/scatterplot-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { GeoArrowScatterplotLayer } from "@geoarrow/deck.gl-layers";
import { useParquetWasm } from "./parquet";
import { useAccessorState, useTableBufferState } from "./accessor";

import "maplibre-gl/dist/maplibre-gl.css";

const DEFAULT_INITIAL_VIEW_STATE = {
latitude: 10,
longitude: 0,
Expand Down Expand Up @@ -84,7 +86,6 @@ function App() {
}
controller={true}
layers={layers}
// ContextProvider={MapContext.Provider}
>
<Map mapStyle={MAP_STYLE} />
</DeckGL>
Expand Down
2 changes: 2 additions & 0 deletions src/solid-polygon-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { GeoArrowSolidPolygonLayer } from "@geoarrow/deck.gl-layers";
import { useParquetWasm } from "./parquet";
import { useAccessorState, useTableBufferState } from "./accessor";

import "maplibre-gl/dist/maplibre-gl.css";

const DEFAULT_INITIAL_VIEW_STATE = {
latitude: 10,
longitude: 0,
Expand Down
Empty file removed src/styles.css
Empty file.

0 comments on commit 6830734

Please sign in to comment.