Skip to content
Discussion options

You must be logged in to vote

You should be able to add images directly inside the Leaflet popup using normal HTML. CRS.Simple should not really change anything with how the popup itself works.

For example, if you have something like:

L.marker([100, 200])
    .addTo(map)
    .bindPopup("Some text");

you can just put an <img> tag inside bindPopup():

L.marker([100, 200])
    .addTo(map)
    .bindPopup(`
        <div>
            <h3>Marker Title</h3>
            <img src="images/example.jpg"
                 alt="Screenshot"
                 style="width:250px; max-width:100%; height:auto;">
            <p>Some text here</p>
        </div>
    `);

If you are hosting it through GitHub Pages, I would probably keep the ima…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@warrenwoodhouse
Comment options

@warrenwoodhouse
Comment options

@warrenwoodhouse
Comment options

Answer selected by warrenwoodhouse
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other General topics and discussions that don't fit into other categories, but are related to GitHub Question Ask and answer questions about GitHub features and usage Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates GitHub Learn Discussions around the GitHub Learn platform
2 participants