-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kharude, Sachin <[email protected]>
- Loading branch information
Kharude, Sachin
committed
Mar 23, 2021
1 parent
4bf503c
commit 1803d79
Showing
4 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters