Skip to content

Commit fbe0378

Browse files
author
Stefan Kuethe
committed
Add TileJSON source
1 parent 403f725 commit fbe0378

File tree

16 files changed

+166
-141
lines changed

16 files changed

+166
-141
lines changed

docs/concepts/controls.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Controls
2+
13
Controls are user interface elements that you can add to your map:
24

35
```python

docs/concepts/interactions.md

Whitespace-only changes.

docs/concepts/layers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Sources state which data the map should display.
2424
2525
## Styles
2626

27-
Vector layers can be styled with a style object containing properties for _stroke_, _fill_, etc.:
27+
Vector layers are styled with an object containing properties for the different styles, such as _stroke_, _fill_, _circle_ or _icon_:
2828

2929
```python
3030
style = ol.FlatStyle(

docs/examples/concepts/sources.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import openlayers as ol
22

3-
geojson = "https://openlayers.org/en/latest/examples/data/geojson/roads-seoul.geojson"
4-
geotiff = "https://s2downloads.eox.at/demo/EOxCloudless/2020/rgbnir/s2cloudless2020-16bits_sinlge-file_z0-4.tif"
5-
pmtiles = "https://r2-public.protomaps.com/protomaps-sample-datasets/nz-buildings-v3.pmtiles"
6-
73
geojson_source = ol.VectorSource(
8-
url=geojson
4+
url="https://openlayers.org/en/latest/examples/data/geojson/roads-seoul.geojson"
95
)
106

117
geotiff_source = ol.GeoTIFFSource(
12-
sources=[{"url": geotiff}]
8+
sources=[{"url": "https://s2downloads.eox.at/demo/EOxCloudless/2020/rgbnir/s2cloudless2020-16bits_sinlge-file_z0-4.tif"}]
139
)
1410

1511
pmtiles_source = ol.PMTilesVectorSource(
16-
url=pmtiles,
12+
url="https://r2-public.protomaps.com/protomaps-sample-datasets/nz-buildings-v3.pmtiles",
1713
attributions=["© Land Information New Zealand"]
1814
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# See https://openlayers.org/en/latest/examples/tilejson.html
2+
3+
import openlayers as ol
4+
5+
layer = ol.TileLayer(
6+
source=ol.TileJSON(
7+
url="https://maps.gnosis.earth/ogcapi/collections/NaturalEarth:raster:HYP_HR_SR_OB_DR/map/tiles/WebMercatorQuad?f=tilejson"
8+
)
9+
)
10+
11+
m = ol.Map(layers=[layer])
12+
m.save()

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ nav:
3737
- Map: concepts/map.md
3838
- Controls: concepts/controls.md
3939
- Layers and sources: concepts/layers.md
40+
# - Interactions: concepts/interactions.md
4041
- GeoPandas: concepts/geopandas.md
4142
- API documentation:
4243
- Map: api/map.md

src/openlayers/anywidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MapWidget(Map, AnyWidget):
3131

3232
# TODO: Move to features as well
3333
# features_selected = traitlets.List().tag(sync=True)
34-
34+
3535
features = traitlets.Dict().tag(sync=True)
3636

3737
def __init__(

src/openlayers/controls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
ZoomControl,
1313
RotateControl,
1414
ZoomToExtentControl,
15-
DrawControl
15+
DrawControl,
1616
)
1717

1818
__all__ = [
@@ -22,5 +22,5 @@
2222
"ScaleLineControl",
2323
"ZoomSliderControl",
2424
"MousePositionControl",
25-
"DrawControl"
25+
"DrawControl",
2626
]

src/openlayers/export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def write_file(content: str, path: Path | str = None) -> str:
2424
if path:
2525
with open(path, "w") as f:
2626
f.write(content)
27-
27+
2828
return path
2929

3030
fd, path = tempfile.mkstemp(prefix="ol_")

src/openlayers/js/openlayers.anywidget.js

Lines changed: 57 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)