Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
haseeb33 opened this issue Mar 29, 2022 · 12 comments
Closed

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

haseeb33 opened this issue Mar 29, 2022 · 12 comments

Comments

@haseeb33
Copy link

haseeb33 commented Mar 29, 2022

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

@giswqs
Copy link

giswqs commented Mar 29, 2022

You need to use folium rather than ipyleaflet in this example

@haseeb33
Copy link
Author

@giswqs I ran the example code provided by the library document. And here we meet again. 😄

@giswqs
Copy link

giswqs commented Mar 29, 2022

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

@haseeb33
Copy link
Author

@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.

@banesullivan
Copy link
Owner

🤦‍♂️that method should be add_layer for ipyleaflet. I will update this asap

Regarding your remote environment, what is the environment?

banesullivan added a commit that referenced this issue Mar 30, 2022
@haseeb33
Copy link
Author

@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!

@banesullivan
Copy link
Owner

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

@haseeb33
Copy link
Author

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

@banesullivan
Copy link
Owner

banesullivan commented Mar 30, 2022

If it helps, there is a Jupyter dockerfile here: https://github.com/banesullivan/localtileserver/blob/main/jupyter.Dockerfile

which is published here: https://github.com/banesullivan/localtileserver/pkgs/container/localtileserver-jupyter

@giswqs
Copy link

giswqs commented Mar 30, 2022

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

@Dodekaphonia
Copy link

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

@banesullivan
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants