Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
Signed-off-by: Kharude, Sachin <[email protected]>
  • Loading branch information
Kharude, Sachin committed Mar 23, 2021
1 parent 4bf503c commit 1803d79
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 7 deletions.
4 changes: 3 additions & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ dependencies:
- pip
- xyzspaces
- jupyterlab=3
- geopandas
- pip:
- "-r ../docs/requirements.txt"
- here-map-widget-for-jupyter
6 changes: 0 additions & 6 deletions binder/postBuild
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
# installing from master branch
npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/here-node/
pip install -e .
jupyter nbextension install --py --sys-prefix here_map_widget
jupyter nbextension enable here_map_widget --py --sys-prefix

# Notebooks with extensions that auto-run code must be "trusted" to work the first time
jupyter trust examples/*.ipynb
59 changes: 59 additions & 0 deletions docs/source/api_reference/layer/tile_layer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
ImageTile Layer
===============
To load tiles from XYZ tile servers like `OpenStreetMap <https://wiki.openstreetmap.org/wiki/Tile_servers>`_ tile servers or WMTS tile servers, ``ImageTileProvider`` is used as a source of data
for TileLayer.

XYZ Tile server Example
-----------------------

.. jupyter-execute::

import os
from here_map_widget import Map, ImageTileProvider, TileLayer

m = Map(api_key=os.environ["LS_API_KEY"], center=[39.40, -104.08], zoom=3)

url = "https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution = (
'Map data (c) <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'
)
provider = ImageTileProvider(url=url, attribution=attribution)
layer = TileLayer(provider=provider)
m.add_layer(layer)
m


WMTS Example
------------

.. jupyter-execute::

import os
from here_map_widget import Map, ImageTileProvider, TileLayer


m = Map(api_key=os.environ["LS_API_KEY"], center=[39.40, -104.08], zoom=3.66)

url = "https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/?layer=0&style=default&tilematrixset=EPSG%3A4326&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}"
provider = ImageTileProvider(url=url)
layer = TileLayer(provider=provider)
m.add_layer(layer)
m



Attributes
----------

.. csv-table::
:header: "Attribute", "Type", "Doc"
:widths: 30, 30, 30

"url", "String", "URL of the Tile server."
"min_zoom", "Int", "Optional, The minimum supported zoom level, the default is 0"
"max_zoom", "Int", "Optional, The maximum supported zoom level, the default is 22"
"opacity", "Float", "Optional, The opacity to use for the rendering of the provided tiles in range [0..1] where 0.0 means full transparent and 1.0 means full opaque."
"tile_size", "Int", "Optional, The size of a tile as edge length in pixels. It must be 2^n where n is in the range [0 ... 30]."
"headers", "Dict", "Optional,A dictionaary of headers to be sent with each request made by the provider."
"attribution", "String", "Optional, Tiles service attribution."

1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ For full list of functionalities please see below sections.
api_reference/layer/kml
api_reference/layer/heatmap
api_reference/layer/markercluster
api_reference/layer/tile_layer


.. toctree::
Expand Down

0 comments on commit 1803d79

Please sign in to comment.