The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Help with displaying png on website
Aendoran
post Jan 30 2024, 12:42 PM
Post #1





Group: Members
Posts: 1
Joined: 30-January 24
Member No.: 29,122



Hi there,

I have been working on a GitHub hosted page for my job, using this tutorial from Mapbox - https://docs.mapbox.com/help/tutorials/buil...-store-locator/ (I have very limited coding skills so this is way beyond my knowledge). On the left side of the store locator, there is a list of our stores that is clickable and directs the map to zoom in on the store location. I am trying to add emojis to each listing to easily describe what is available at a store (a quick visual indicator), but every time I try to add an image, the website fully breaks. My issue is that I can't just simply print out the emoji as the html code needs to variably print out three different emojis, based on what is available at each store. So each store has its own initialization and then the code later out just prints out the store properties.

I would love any and all help - thanks!


Here are some of the various codes that I wrote to try to get the emoji's to print:
1)
CODE

/*Creates the image using the image source*/
<div id="image">
        <img id="ConeEmoji" src="https://static.thenounproject.com/png/79716-200.png" width="5" height="5">
        </div>
.
.
.
/*Establishes the store properties that are later used to build the actual listing*/
const stores = {
        'type': 'FeatureCollection',
        'features': [
          {
            'type': 'Feature',
            'geometry': {
              'type': 'Point',
              'coordinates': []
            },
            'properties': {
              'address': '',
              'productType': '',
              'storeName': '',
              'city': '',
              'postalCode': '',
              'state': '',
              'addresslink': '',
              'emoji' : 'ConeEmoji'
            }
          },
.
.
.
/*Creates the store listing*/
link.innerHTML = `${store.properties.emoji}`;


2)
CODE

const stores = {
        'type': 'FeatureCollection',
        'features': [
          {
            'type': 'Feature',
            'geometry': {
              'type': 'Point',
              'coordinates': []
            },
            'properties': {
              'address': '',
              'productType': '',
              'storeName': '',
              'city': '',
              'postalCode': '',
              'state': '',
              'addresslink': '',
              'emoji' : 'https://static.thenounproject.com/png/79716-200.png'
            }
          },
.
.
.
/*Creates the store listing*/
link.innerHTML = `${store.properties.emoji}`;

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 20th May 2024 - 08:12 AM