function createListElement(commentInJson) {
  const text = commentInJson.text;
  const blobKey = commentInJson.blobKey;
  const landmark = commentInJson.landmark;

  const liElement = document.createElement('li');
  const textElement = document.createElement('p');
  textElement.innerText = text;
  liElement.appendChild(textElement);

  if (blobKey != null) {
    const imageElement = document.createElement('img');
    imageElement.src = "/serve-image?blob-key=" + blobKey.blobKey;
    liElement.appendChild(imageElement);
  }

  if (landmark != null) {
    const landmarkNameElement = document.createElement('p');
    landmarkNameElement.innerText = landmark.name;
    const landmarkLatLng = document.createElement('p');
    landmarkLatLng.innerText = "(" + landmark.latitude + ", " +
                                          landmark.longitude + ")";
    liElement.appendChild(landmarkNameElement);
    liElement.appendChild(landmarkLatLng);
  }
  return liElement;
}
/**
 * Creates an <li> element containing the comment data.
 *
 * Each comment contains a message text, image, landmark name/location,
 * and landmark latitude-longitude coordinates. However, both the blobKey
 * and landmark fields of the comment JSON object can be null. If the  
 * blobKey value null, no image element is included in the parent <li> element.
 * If the landmark value is null, no landmark information is included. 
 * 
 * @param {JSON} commentInJson A string that contains a JSON object of an 
 *    individual comment. This JSON object contains fields for message text,
 *    image, landmark name, and landmark latitude-longitude coordinates.
 * @return {HTMLLIElement} The list element created.
 */
Creates an  element containing the comment data.
Each comment contains a message text, image, landmark name/location,
and landmark latitude-longitude coordinates. However, both the blobKey
and landmark fields of the comment JSON object can be null. If the
blobKey value null, no image element is included in the parent  element.
If the landmark value is null, no landmark information is included.

@param {JSON} commentInJson A string that contains a JSON object of an
individual comment. This JSON object contains fields for message text,
image, landmark name, and landmark latitude-longitude coordinates.
@return {HTMLLIElement} The list element created.
Creates an element containing the comment data . Each comment contains a message text image landmark name / location and landmark latitude - longitude coordinates . However both the blobKey and landmark fields of the comment JSON object can be null . If the blobKey value null no image element is included in the parent element . If the landmark value is null no landmark information is included . @param { JSON } commentInJson A string that contains a JSON object of an individual comment . This JSON object contains fields for message text image landmark name and landmark latitude - longitude coordinates . @return { HTMLLIElement } The list element created .
function createListElement(commentInJson) {
  const text = commentInJson.text;
  const blobKey = commentInJson.blobKey;
  const landmark = commentInJson.landmark;
  const liElement = document.createElement('li');
  const textElement = document.createElement('p');
  textElement.innerText = text;
  liElement.appendChild(textElement);
  if (blobKey != null) {
    const imageElement = document.createElement('img');
    imageElement.src = "/serve-image?blob-key=" + blobKey.blobKey;
    liElement.appendChild(imageElement);
  }
  if (landmark != null) {
    const landmarkNameElement = document.createElement('p');
    landmarkNameElement.innerText = landmark.name;
    const landmarkLatLng = document.createElement('p');
    landmarkLatLng.innerText = "(" + landmark.latitude + ", " +
                                          landmark.longitude + ")";
    liElement.appendChild(landmarkNameElement);
    liElement.appendChild(landmarkLatLng);
  }
  return liElement;
}
function createListElement ( commentInJson ) { const text = commentInJson . text ; const blobKey = commentInJson . blobKey ; const landmark = commentInJson . landmark ; const liElement = document . createElement ( 'li' ) ; const textElement = document . createElement ( 'p' ) ; textElement . innerText = text ; liElement . appendChild ( textElement ) ; if ( blobKey != null ) { const imageElement = document . createElement ( 'img' ) ; imageElement . src = "/serve-image?blob-key=" + blobKey . blobKey ; liElement . appendChild ( imageElement ) ; } if ( landmark != null ) { const landmarkNameElement = document . createElement ( 'p' ) ; landmarkNameElement . innerText = landmark . name ; const landmarkLatLng = document . createElement ( 'p' ) ; landmarkLatLng . innerText = "(" + landmark . latitude + ", " + landmark . longitude + ")" ; liElement . appendChild ( landmarkNameElement ) ; liElement . appendChild ( landmarkLatLng ) ; } return liElement ; }
Creates an <li> element containing the comment data.
Creates an <li > element containing the comment data .