Esri / application-boilerplate-3x-js

Starter application that simplifies the process of building templates for the ArcGIS.com template gallery.
https://developers.arcgis.com/javascript/
Apache License 2.0
90 stars 68 forks source link

getViewProperties() shouldn't take string array #89

Closed alaframboise closed 7 years ago

alaframboise commented 7 years ago

We might not want to depend on splitting an incoming string for ui components because UI doesn't support loading all widgets (components) by string - just zoom, compass and attribution. Furthermore, the location e.g. top-right of the ui component should also be passed in so I think we need to re-think this structure.

https://github.com/Esri/application-boilerplate-js/blob/4master/js/boilerplate/UrlParamHelper.js#L56

Here's how I handle it in config.json and and use main.js to set up the UI.

{
  "appid": "",
  "group": "",
  "title": "",
  "subtitle": "",
  "about": "",
  "webmap": "de5fe9b1be9b43a9aa195164438b557f",
  "webscene": "",
  "uiComponents": {
    "zoom": {
      "visible": true,
      "position": "top-left"
    },
    "attribution": {
      "visible": true,
      "position": "top-left"
    },
    "search": {
      "visible": true,
      "position": "custom"
    }
  },
...
driskull commented 7 years ago

@kellyhutchins what do you think? I think you wrote this piece, correct?

kellyhutchins commented 7 years ago

@driskull @alaframboise I'm fine with updating to the structure Al proposes or perhaps a better option would be to leave the ui component bit out of the boilerplate. Group templates wouldn't support this behavior so perhaps we just leave it up to the template developer to add config for the components they want users to be able to configure.

alaframboise commented 7 years ago

Hey @kellyhutchins, with the flexibility of the new UI components, it's easy to allow users to add/remove UI components and position them with just strings, so I think it might be a good idea to leave this out of boilerplate and leave it up to the app to configure the UI from config.json?

When I get a little further along I can show you.

driskull commented 7 years ago

Ok. can you submit a PR to remove them?

driskull commented 7 years ago

looks like this is good now.