Esri / dojo-bootstrap-map-js

Samples for how to use the Esri ArcGIS API for JavaScript w/ Bootstap via Dojo-bootstrap
Apache License 2.0
71 stars 83 forks source link

Figure out the best way to include multiple example pages in this single repo #65

Closed tomwayson closed 9 years ago

tomwayson commented 9 years ago

I want this repo to include three different example pages:

1) Top nav (current) layout w/ a web map 2) Side bar layout (see #24) that loads the map from individual layers in the config. This would also be the one that we'd include the configuration/instructions to do a Dojo Build 3) A dashboard layout based on something like http://keen.github.io/dashboards/examples/sfmta-parking/

I need to figure out what is the best way to include all 3 in the single repo. I can think of two different ways, both involve multiple top level documents (i.e. index.html, sidebar.html, dashboard.html, etc). The question is whether the supporting files (the different config, controllers, and layouts) for each of those all reside under the same application (package) or separate applications/packages:

Same Application:

└───src
    │   dashboard.html
    │   index.html (would default to the current, top nav layout)
    │   sidebar.html
    │   unbuilt.html (would be an un-built configuration of the side bar layout)
    │
    └───app
        │   dashboardConfig.js
        │   dahsboardController.js
        │   sidebarConfig.js
        │   sidebarController.js
        │   topnavConfig.js
        │   topnavController.js
        │
        ├───layout
        │   │   Dashboard.js
        │   │   SideBar.js
        │   │   TopNav.js
        │   │
        │   ├───nls
        │   │
        │   └───templates
        │           Dashboard.html
        │           SideBar.html
        │           TopNav.html
        │
        ├───mapping
        │   │   Map.js
        │   │
        │   └───templates
        │           Map.html
        │
        └───resources
                app.css
                main.css

Different Applications (packages)

└───src
    │   dashboard.html
    │   index.html (would default to the current, top nav layout)
    │   sidebar.html
    │   unbuilt.html (would be an un-built configuration of the side bar layout)
    │
    ├───DashboardApp
    │   │   config.js
    │   │   Controller.js
    │   │
    │   ├───layout
    │   │   │   Dashboard.js
    │   │   │
    │   │   ├───nls
    │   │   │
    │   │   └───templates
    │   │           Dashboard.html
    │   │
    │   ├───mapping
    │   │   │   Map.js
    │   │   │
    │   │   └───templates
    │   │           Map.html
    │   │
    │   └───resources
    │           app.css
    │           main.css
    ├───SidebarApp
    │   │   config.js
    │   │   Controller.js
    │   │
    │   ├───layout
    │   │   │   SideBar.js
    │   │   │
    │   │   ├───nls
    │   │   │
    │   │   └───templates
    │   │           SideBar.html
    │   │
    │   ├───mapping
    │   │   │   Map.js
    │   │   │
    │   │   └───templates
    │   │           Map.html
    │   │
    │   └───resources
    │           app.css
    │           main.css
    └───TopNavApp
        │   config.js
        │   Controller.js
        │
        ├───layout
        │   │   TopNav.js
        │   │
        │   ├───nls
        │   │
        │   └───templates
        │           TopNav.html
        │
        ├───mapping
        │   │   Map.js
        │   │
        │   └───templates
        │           Map.html
        │
        └───resources
                app.css
                main.css

I'm leaning towards the different packages approach b/c it's unlikely that anyone would use multiple layouts/configs, etc w/in the same app, which would make any one of the individual apps a better starting point for someone than a single app that has them all. The problem w/ that is the duplication of the map widget in each app. That could be resolved by make it it's own package at the same level as the apps.

I'm curious if @tsamaya or any other users of this repo have thoughts on which folder/package structure would make the most sense.

Thanks!

nickpeihl commented 9 years ago

Hi Tom, For my money, different packages would be the best way to go. Let the users pick an app and delete the others if necessary. This way they can remove the cruft easily.

tomwayson commented 9 years ago

Thanks @npeihl!

That's how I'm leaning too.

tsamaya commented 9 years ago

Hi Tom and Nick,

regardings apps, I agree, diffrents apps : it is easier to delete unecessary fodlers. But regarding maintaining source files, I think it is easier to have only one app folder. For the demos, and the gh-pages the index.html may explain the diffrents sample and point then on dashbord, simpleTopNav and the sidebar sample, in each sample diffrent config files could be injected.

tomwayson commented 9 years ago

Thank you @tsamaya and @npeihl for your thoughts.

I ended up deciding to implement this in a separate repo, see:

http://tomwayson.github.io/responsive-citizens/dashboard.html https://github.com/tomwayson/responsive-citizens

tsamaya commented 9 years ago

This is really nice ! you should put a link on the dojo-bootstrap-map-js readme.md as a sample implementation !

tomwayson commented 9 years ago

Thanks @tsamaya - that was my demo for DevSummit. I thought I already had added a link to the README, but I guess that slipped through the cracks.

tsamaya commented 9 years ago

I was think about something like that : https://github.com/tsamaya/dojo-bootstrap-map-js/commit/b6fd92d994bff8ecef57fefea33dd3e043056a68#diff-04c6e90faac2675aa89e2176d2eec7d8

2015-03-20 15:20 GMT+01:00 Tom Wayson notifications@github.com:

Thanks @tsamaya https://github.com/tsamaya - that was my demo for DevSummit. I thought I already had added a link to the README, but I guess that slipped through the cracks.

— Reply to this email directly or view it on GitHub https://github.com/Esri/dojo-bootstrap-map-js/issues/65#issuecomment-84030078 .