Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View image on pupup from geoJSON #34

Open
andres-ss25 opened this issue Jan 28, 2021 · 1 comment
Open

View image on pupup from geoJSON #34

andres-ss25 opened this issue Jan 28, 2021 · 1 comment

Comments

@andres-ss25
Copy link

Hello
I have a Geo JSON that contains the path in the project of some images. How do I make the image appear in the brand's popup.
mapa

@slead
Copy link
Contributor

slead commented Jan 29, 2021

Hola Andres,

There is nothing in the app to support this yet, but it's a good idea.

Within app.js there is a function configurePopup which creates the table containing the key:value pairs. The function formatPopup then calls formatValue to format the value for decimal places, dates, text prefix, etc:

function formatValue(value, field){
  // (summarised code)
  // Given a value and a field definition, apply the appropriate formatting
  // Used in the Query Widget and Identify functions

    if (field.decimals !== undefined) {
      value = round(value, field.decimals);
    }
    if (field.date !== undefined && value !== null){
      ...
        var theDate = moment(new Date(value));
    }
    if (field.thousands !== undefined) {
      value = addThousandsSeparator(value);
    }
    if (field.prefix !== undefined){
      value = field.prefix + value;
    }

  return (value);
}

You could add a check here for image and if so add the image source. (A hyperlink would also be useful here).

Unfortunately I won't have time to do this in the near future, but please feel free to submit a pull-request if you have the time to do this.

Cheers,
Steve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants