banesullivan/localtileserver

AttributeError: 'Map' object has no attribute 'add_child'

haseeb33 opened this issue Β· 12 comments

I am trying to run the minimal example and getting this error. Maybe I am missing something big.
Screen Shot 2022-03-30 at 8 14 15 AM

Report:

Date: Tue Mar 29 23:20:12 2022 UTC

                 OS : Linux
             CPU(s) : 8
            Machine : x86_64
       Architecture : 64bit
                RAM : 31.4 GiB
        Environment : Jupyter

  Python 3.8.10 (default, Nov 26 2021, 20:14:08)  [GCC 9.3.0]

    localtileserver : 0.4.4
              flask : 2.1.0
      flask_caching : 1.10.1
        flask_restx : 0.5.1
           requests : 2.27.1
           werkzeug : 2.0.3
              click : 8.0.4
             scooby : 0.5.12
        large_image : 1.12.0
large_image_source_gdal : 1.12.0
         cachetools : 5.0.0
                PIL : 9.0.1
             psutil : 5.9.0
              numpy : 1.22.3
         palettable : 3.3.0
             pyproj : 3.3.0
         osgeo.gdal : 3.0.4
         ipyleaflet : 0.15.0
          traitlets : 5.1.1
            shapely : 1.8.1.post1
             folium : 0.12.1.post1
         matplotlib : 3.5.1

You need to use folium rather than ipyleaflet in this example

@giswqs I ran the example code provided by the library document. And here we meet again. πŸ˜„

So, did the example work for your Jupyter on a remote server?

@giswqs No, it's not working and I have been reading previous issues (#1 #29 #66) on this repo and found it's way more complicated than it looks.

πŸ€¦β€β™‚οΈthat method should be add_layer for ipyleaflet. I will update this asap

Regarding your remote environment, what is the environment?

@banesullivan We have a physical server, placed and run from one place. Jupyter notebook docker is installed on it so everyone can access it with a simple link. We access it like a website.

Specs of it are shown in the report mentioned above. Let me know if there are some specific questions about the server.
Thanks!

I think you will want to use the jupyter server proxy set up in that scenario (otherwise, you need to expose the port on which localtileserver is running inside the docker container). Hopefully this guide is all you need: https://localtileserver.banesullivan.com/installation/remote-jupyter.html

@banesullivan Thank you very much for the quick response. I will give it a try.

@haseeb33 Once you get the example to work, you should then be able to use geemap's add_local_tile() function as usual.

Hi!
I'm sorry to comment on the closed issue, but my question is very familiar to the original one (as well as to #29 #66). I'm trying to use localtileserver for displaying image with folium on remote Jupyter Hub (physical server) and the image is not showing. As far as I understand, instead of TileClient function I need to use RemoteTileClient.
I've tried already:

RemoteTileClient('image.tif', host = 'http://127.0.0.1:port',  default_projection='EPSG:3031')
RemoteTileClient('image.tif', host = 'http://127.0.0.1', default_projection='EPSG:3031')
RemoteTileClient('image.tif', host = 'http:/user/username/', default_projection='EPSG:3031')

hostname (http://127.0.0.1) and port were recieved with

from notebook import notebookapp
servers = list(notebookapp.list_running_servers())
print(servers)

So my question is what is the correct way to pass host and port to RemoteTileClient function? Or am I missing something?

For remote JupyterHub I followed this instruction: https://localtileserver.banesullivan.com/installation/remote-jupyter.html
I'm using localtileserver v.0.6.1
Displaying the same image locally works perfectly.
Also, I've encountered a 404 Client Error, when not specifying default_projection for RemoteTileClient (my data is in EPSG:3031), while for TileClient it was not necessary

@Dodekaphonia, would you please open a new issue for this?