Skip to content

how to off toolbar and export to png/image #526

Answered by giswqs
rh-afk asked this question in Q&A
Discussion options

You must be logged in to vote

To hide the toolbar

m = leafmap.Map(toolbar_control=False)

To allow users to download a file from the server:

def create_download_link(filename, title="Click here to download: "):
    """Downloads a file from voila. Adopted from https://github.com/voila-dashboards/voila/issues/578

    Args:
        filename (str): The file path to the file to download
        title (str, optional): str. Defaults to "Click here to download: ".

    Returns:
        str: HTML download URL.
    """
    import base64

    from IPython.display import HTML

    data = open(filename, "rb").read()
    b64 = base64.b64encode(data)
    payload = b64.decode()
    basename = os.path.basename(filename)
    html = '<a…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rh-afk
Comment options

@giswqs
Comment options

@rh-afk
Comment options

@giswqs
Comment options

Answer selected by giswqs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants