Icon(icon_url="local_file.png") not working
See original GitHub issueHello, 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:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
It’s here now https://ipyleaflet.readthedocs.io/en/latest/layers/local_tile_layer.html