GithubHelp home page GithubHelp logo

ecaldwell / application-boilerplate-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from esri/application-boilerplate-3x-js

0.0 2.0 1.0 154 KB

Starter application that simplifies the process of building templates for the ArcGIS.com template gallery.

License: Apache License 2.0

JavaScript 98.73% CSS 1.27%

application-boilerplate-js's Introduction

application-boilerplate-js

The Application Boilerplate is a starter application for building custom templates with the ArcGIS API for JavaScript.

Features

This bare-bones app includes all the code you need to build an ArcGIS Online template. It will save you time when:

  • Making an ArcGIS Online compatable template.
  • Using your ArcGIS Online webmap to power the template.
  • Localizing your application in different languages.
  • Capturing URL parameters and using them in your application.
  • Using settings from your ArcGIS Online organization or configured application.
  • Enabling your application to sign-in to ArcGIS Online using oAuth2.

View it live

App

Getting Started

Review the following ArcGIS.com help topics for details on Templates:

Folders and Files

The template consists of the following folders and files:

/config/: A folder for your application's configuration files.

  • defaults.js: Define the default configuration information for the template. You can use this file to specify things like a default web map id, a proxy url, default services, a Bing maps key, default color theme and other template-specific settings.

/css/: Contains the CSS files for the application.

  • main.css This file contains the map styles that set the margin, padding and initial height (100%).

/images/: Contains images used by the application.

/js/: Contains 3 JavaScript files and 1 folder:

  • /nls/: The nls folder contains a file called template.js that contains the strings used by the application. If the application needs to be supported by multiple locales you can create a folder for each locale and inside that folder add a template.js file with the translated strings. See the template.js file in the nls/fr folder for an example of this in French.
  • main.js: Creates the map based on configuration info. You will write all your main application logic in here.
  • oAuthHelper.js: Allows your template to authenticate to secured or private ArcGIS Online content and items via oAuth2. You most likely will not need to modify this file.
  • template.js: Module that takes care of "template"-specific work like retrieving the application configuration settings by appid, getting the url parameters (web map id and appid), handling localization details and retrieving organization specifc info if applicable. You will most likely not need to modify this file. Also sets the proxy and geometry service if the url's have been provided in the defaults.js file or are available from the org. Once executed you'll have access to an object that contains properties that give you access to the following:
    • Template specific properties
    • appid
    • webmap
    • helperServices: geometry, print, locator service urls
    • i18n: Strings and isRightToLeft property that can be used to determine if the application is being viewed from a language where text is read left-to-right like Hebrew or Arabic.
    • proxy url

index.html: The default html file for the application.

configurationPanel.js Default configuration panel settings for the template. This is only applicable to configurable templates. This example will create a configuraiton panel with one dropdown list that contains three template color choices (seaside, chrome, pavement). When the templateConfig.js module retrieves any configurable settings you'll get the theme name back in a parameter named theme. Then you can apply the necessary css to your application to apply the new colors - like change the border color etc. See the Adding configurable parameters to templates help topic for more details.

Instructions

  1. Download and unzip the .zip file or clone the repository.
  2. Web-enable the directory.
  3. Access the .html page.
  4. Start writing your template!

New to Github? Get started here.

Requirements

  • Notepad or HTML editor
  • A little background with JavaScript
  • Experience with the ArcGIS JavaScript API would help.

Resources

Issues

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

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

Copyright 2013 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 ArcGIS Online Web Application boilerplate template widget dijit Esri JavaScript application) [](Esri Language: JavaScript)

application-boilerplate-js's People

Contributors

driskull avatar kellyhutchins avatar steveoh avatar

Watchers

 avatar  avatar

Forkers

gishub

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.