question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LocalTileLayer not visible

See original GitHub issue

The following shows open street map but no additional layers:

import ipyleaflet
m = ipyleaflet.Map(center=(10, 36),zoom=5)
m.add_layer(ipyleaflet.LocalTileLayer(url="./tileset/{z}/{x}/{y}.png"))
m

No errors or anything in the jupyter lab console log.

I created the tileset with gdal2tiles, which conveniently creates a “leaflet.html” file within “./tileset”. When I use the jupter lab file browser to open that html file in a new browser window, I get a lot of 403’s saying “blocking request with no referer”. But I don’t see anything like that in the javascript console with they ipyleaflet chunk above, so possibly not relevant.

Some version info:

$ pip list | grep ipy
ipykernel                     5.1.2      
ipyleaflet                    0.11.2     
ipython                       7.6.1      
ipython-genutils              0.2.0      
ipywidgets                    7.5.1      
scipy                         1.2.1      
$ pip list | grep jupyter
jupyter                       1.0.0      
jupyter-client                5.3.1      
jupyter-console               6.0.0      
jupyter-core                  4.5.0      
jupyterlab                    1.1.2      
jupyterlab-git                0.8.1      
jupyterlab-server             1.0.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
itcarrollcommented, Oct 4, 2019

Can confirm it works in Jupyter Lab as you describe. Awesome!

0reactions
martinRenoucommented, Oct 4, 2019

This workaround should work for now, and then when a new release of ipyleaflet is out you will be able to get rid of your CustomLocalLayer class and directly use the LocalTileLayer with the same arguments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Defining and including local tileLayer in Leaflet
For information, a "Tile Layer" is used when you have a map made up of different zoom levels (usually 1 folder per zoom...
Read more >
Use a local tile layer with leaflet
This project will run offline on a computer connected to nothing, so I need to have the tile layer stored on the same...
Read more >
Local Tile Layer — ipyleaflet documentation
Custom tile layer using local tile files. Path to your local tiles. In the classic Jupyter Notebook, the path is relative to the...
Read more >
Visualize Large Complex Data with Local Tile Layers in ...
Don't want to make the tiles available online for security reasons. Creating a local tile layer is not an easy task.
Read more >
I'm new to this SDK and how do you read a tpk file...
If your TPK file is in the app's directory, however, it's pretty easy. ... layer from the local cache ArcGISTiledLayer localTileLayer = new ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found