Coder Social home page Coder Social logo

dojo-bootstrap-map-js's Introduction

dojo-bootstrap-map-js

An application boilerplate demonstrating how to use the Esri ArcGIS API for JavaScript with Bootstrap Map and Dojo Bootstrap to create a responsive mapping application using Bootstrap components.

View it live

App Screenshot

This boilerplate is ideal for mobile applications because it provides the responsive UI of Bootstrap without the overhead of loading all of jQuery. Furthermore, you can run a Dojo build to optimize all of the JavaScript and CSS source code and dependencies to get a roughly 95% reduction in number of requests for scripts and 25% reduction in the size of those scripts.

This application boilerplate demonstrates how to build a mapping application that utilizes the best parts of Dojo (AMD modules, classes and widgets, promises, i18n, custom builds, etc) along with the responsive UI of Bootstrap. For simpler examples of how to get started with Bootstrap Map and Dojo Bootstrap, see the Boostrap Map demo pages.

Instructions

By default, this boilerplate assumes you will want to work from local copies of all dependencies so that you can create a custom build. However, you can also work off of remotely hosted (CDN) dependencies by using nobuild.html.

Quick Start

  1. Download or Fork and clone the repo
  2. Make sure the dojo-bootstrap-map-js folder is served via your local web server
  3. Load src/index.html in your browser

Downloading Dependencies and Building

You will need to install Node, Bower, and Grunt in order to download dependencies and build the app via the command line.

  1. Fork and clone the repo
  2. cd into the dojo-bootstrap-map-js folder
  3. Run npm install to install the Grunt tasks
  4. Run bower install to download Dojo and other dependencies
  5. Run grunt serve to load the unbuilt app into a web browser
  6. Modify the code as needed
  7. Run grunt build to build the app under the dist folder
  8. Run grunt serve:build to load the built app into a web browser

You may want to run grunt clean:deploy to remove all uncompressed javascript and source maps before you deploy the contents of that folder to your web server.

Requirements

  • Notepad or your favorite text editor
  • Web browser with access to the Internet
  • Node, Bower, and Grunt to run the command line development tools
  • Java, in order to build Dojo.

Example Applications

Below are a few example applications that have been built using this boilerplate:

  • Demo for DevSummit 2015, responsive-citizens, a responsive take on the Attribute editing - mobile sample. Github repo.
  • San Juan County GIS, traffic-collisions-app, A web application showing traffic collisions in San Juan County. Filterable by island and severity. Github repo
  • City of Menlo Park, General Plan Review, a wep application that allows users to dynamically modify the proposed general plan and view the impact on a map and chart.

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Anyone and everyone is welcome to contribute.

Licensing

Copyright 2012 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.

[](Esri Tags: ArcGIS Web Mapping Bootstrap) [](Esri Language: JavaScript)​

dojo-bootstrap-map-js's People

Contributors

alaframboise avatar benstoltz avatar leighghunt avatar tomwayson avatar tsamaya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dojo-bootstrap-map-js's Issues

grunt build fails on dojo:dist task if Java not present

When building on a Windows machine without Java installed, I encountered the following error:

c:\inetpub\wwwroot\dojo-bootstrap-map-js>grunt build
Running "jshint:all" (jshint) task
>> 10 files lint free.

Running "clean:build" (clean) task
>> 0 paths cleaned.

Running "dojo:dist" (dojo) task

Building Dojo...
>> Error
Warning: Task "dojo:dist" failed. Use --force to continue.

Aborted due to warnings.

Map loading indicator

Hi @tomwayson

What are your thoughts on adding a map loading indicator? I'm thinking a spinner like Spinjs. might be helpful.

I've added it to my work-in-progress webapp based on Dojo-bootstrap-map-js. Only problem is I can't get Dojo to build with it. I've tried adding a copyOnly resource tag in app.profile.js, but then I get missing dependencies.

Can't style height of map to 100%

I've been having difficulty getting the map to show the full height of the browser. I originally came across this problem in my own bootstrap/dojo app. After searching around for answers I stumbled upon this repo. I noticed that in index.html you are setting the height inline to be 400px:

When I change the height to try and maximize the map (below snippet), I still get a default map height of 400px from the server:

I can specify a static height OK though:

So I'm having the same problem with both this app and my own. Any ideas?

Thanks in advance,

Shane

Don't use dojo/touch

The nav menu uses touch.press, which emulates mousdown/touchstart when what we want to handle is click. This should eliminate the need to call _hideDropdownNav() in all the event handlers.

Simplify code that parses layers from config

Instead of maintaining custom code to read map info from the config, this repo could just use arcgisUtils.createMap() which is able to take in webmap JSON as the first argument, as shown in this sample.

It looks like bootstrap-map-js just passes that argument through, so it should work.

If that works, there's no point in trying to maintain custom code to load a map from the config since bootstrap-map-js is has arcgisUtils as a dependency, so no matter what, that's going to be on the page.

Update to 3.15

Is there a task or vision to update esri from 3.13 to 3.15 and to swap from slurp over to a bower install or those artifacts?

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

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!

Add ability to have custom basemaps

Looks like there's already a TODO for this here. We prefer to use our own custom basemaps rather than Esri's (nah-nah).

If I can implement, I'll submit a PR. No promises though.

css theme needed

The sample with the webmapid needs a css theme (claro, tundra,..). The pie chart are not visible without such a theme.
PR #54 solves it on the no-build source file

question really, but it was added to issues

I am very new to the bootstrap world -this example is very cool, but when looking at the source it is very confusing to a beginner - in other examples the body of the index.html page usually explains how the page is constructed - in this example it looks like more advanced techniques are used with links elsewhere - I am having trouble figuring out how you are doing the work. I am curious if you have an sample of the same application which has everything on the index.html page, which will make it easier for a bootstrap beginner to see how you are assembling everything? thanks

Make "no build" the default configuration

  • app will default to using hosted JSAPI, bootstrap map, Dojo bootstrap so people can clone and load right away (nobuild.html becomes index.html)
  • current index.html will be renamed build.html and require bower install and esri slurp to run
  • grunt build task remains the same, excecpt copies build.html instead of index.html, or could use grunt-processhtml to do build from index.html
  • change grunt deploy task to use something like grunt-gh-pages
  • need a build.css which includes local dojo/esri.css files and then app.css (which should no longer include those).

See #52 for discussion.

Look into using a stylus port of bootstrap

Like:bootstrap-stylus

A few questions come to mind:

  1. how would it integrate w/ a build system (should be done in conjunction w/ or after #36)
  2. would we also need something to remove unused rules like grunt-uncss
  3. is a local, minimized, pruned set of CSS actually faster for user than using a CDN (that is likely cached in user's client)?

"LayerClass is not a constructor" when not using webmap

Hi Tom,
I just pulled down the latest commits and the sidebar looks great. Unfortunately, when I change the config to not use a webmap, I receive a "LayerClass is not a constructor" error. I believe this line is not passing the LayerClass correctly to initLayer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.