Skip to content

Commit

Permalink
popups better
Browse files Browse the repository at this point in the history
  • Loading branch information
domlet committed Jan 4, 2024
1 parent 5ebce6b commit c690c7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
new mapboxgl.Popup()
.setLngLat(coordinates[0][0])
// .setHTML(stateName)
.setHTML(document.getElementsByClassName("mapboxgl-popup-content").innerHTML = '<img src="' + result.img + '" alt="" /><h2>' + result.title + '</h2><br/><p>' + result.author + '</p>')
.setHTML(document.getElementsByClassName("mapboxgl-popup-content").innerHTML = '<h2>' + result.title + '</h2><img src="' + result.img + '" alt="" /><p>' + result.author + "</p><p>" + result.description + "</p><p><a href='" + result.audiobook_url + "'>Audiobook</a></p>" + "<p>Published: " + result.published + "</p><p>" + result.pagecount + " pages</p><p>Average rating: " + result.average_rating + "</p>")
.addTo(map);
});

Expand Down
6 changes: 3 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ body {
#map { position: absolute; top: 0; bottom: 0; width: 100%;}

.mapboxgl-popup {
max-width: 400px;
/* max-width: 400px; */
font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
width: 15em;
width: 20em;
}

h2 {
Expand All @@ -22,7 +22,7 @@ body {

img {
width: 6em;
margin: 0.5em;
margin: 0.8em;
float: right;
border: 1px solid gray;
border-radius: 0.2em;
Expand Down

0 comments on commit c690c7c

Please sign in to comment.