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.

Icon(icon_url="local_file.png") not working

See original GitHub issue

Hello, I am trying to use a custom image for a marker. The image file is located on my local machine, but I’ve tried a couple different ways to refer to or point to my local image file. I’ve tried:

icon_url=“local_file.png” icon_url=“file:///path/to/local_file.png”

This similar issue https://github.com/jupyter-widgets/ipyleaflet/issues/347 seems to indicate my first example should have worked, but it doesn’t.

I was able to make it work by hosting that image on a localhost, simple HTTP server via python -m http.server, so this worked: Icon(icon_url="http://127.0.0.1:8000/custom_image.png")

I am using jupyter lab on Windows 10 machine with ipywidgets version 7.5.1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
martinRenoucommented, Nov 9, 2020

There is some documentation about this in there: https://ipyleaflet.readthedocs.io/en/latest/api_reference/local_tile_layer.html#example, I guess it’s just a matter of copying this documentation to the Image page for now.

But what I am suggesting is to simplify this logic so that it’s not surprising to users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom and locally stored icon (png) fails to load
I am a new to leaflet.js and I am now following the Leaflet API reference documentation. I am having an issue showing my...
Read more >
Import files into Figma
If you are still having issues importing files, we'd love to help! Contact the Support team by clicking the "?" icon in the...
Read more >
Manage linked or embedded graphics in Adobe InDesign
To embed only one instance, select it and choose Embed Link. The file remains in the Links panel marked with the embedded-link icon...
Read more >
7 Reasons Why Images Are Not Loading on Your Website
Website images fail to load for one of these seven common reasons.
Read more >
How to use local png files to use on google maps
Hi! Creating a web/mobile application in Laravel8.x and vue Want to use local icons for my google maps markers This working (get URL...
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