Skip to content

mgleahy/Viewer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A slightly modified version of the Esri Basic Viewer that allows a custom AMD module to be plugged in and have it appear as one of the panels.

Screen Shot

In the index.html, a custom event emitted by the app class called 'found-custom-tool' can be connected to, which will be triggered for any items in the 'tools' list in defaults.js that has a name that does not match any of the default Viewer tools. This event includes references to the config for the tool (the item specified the tools list in defaults.js), the current array of tools used by the toolbar, and the toolbar object itself. These are sufficient for a custom module to add itself to the list of tools by calling the toolbar.createTool(toolConfig,panelSize) function inside of a method that returns a promise object (toolConfig = the object from the list of tools in defaults.js, and panelSize = "large", "medium" or "small"). The toolbar.createTool() method returns the domNode of the content panel that is displayed when the tool is selected - this is where your custom module can display it's controls/content.

If your tool needs to interact with or add content to the map, you can use the map propety of the toolbar object (as it is returned by the found-custom-tool event).

basic-viewer-template

Basic Viewer is a configurable application template used to display a web map with a specified set of commonly used tools and options.

Screen Shot

[View it live] (http://www.arcgis.com/apps/Viewer/index.html?webmap=f5b13dbed07c46cdb783cf361833aa6b)

#Features The template can be configured using the following options:

  • Map: Choose the web map used in your application.
  • Color Scheme: Choose a color scheme for the application.
  • Show Title: Choose whether to include an application title.
  • Title Text: The application title. The default title is the web map name.
  • Logo: Choose a custom logo for your application.
  • Overview Map: Display a retractable overview map to add context for panning and zooming.
  • Legend: Display a legend for map layers. *
  • Details: Display the web map item description. *
  • Editor: Allows users to interactively create, modify, or delete features in editable layers. *
  • Print: Enables printing the map at the current extent. It can be configured to include a legend and supports different layout options.
  • Layer List: Enables toggling the visibility of operational layers within the web map. *
  • Basemaps: Enables the display of the basemap gallery.
  • Bookmarks: Enables the use of web map bookmarks for navigation. *
  • Measure: Enables measure tool for interactive area, length, and point measurement.
  • Share: Allows users to share the application with others via email, Twitter, or Facebook.
  • Search: Displays the Search box to enable navigation to addresses and places.

*These options will appear in the application when the web map has properties or layers that support them.

#Instructions

  1. Download and unzip the .zip file or clone the repo.
  2. Web-enable the directory.
  3. Access the .html page in a browser

Note: If your application edits features in a feature service, contains secure services or web maps that aren't shared publicly or generates requests that exceed 200 characters you may need to setup and use a proxy page. Common situations where you may exceed the URL length are using complex polygons as input to a task or specifying a spatial reference using well-known text (WKT). For details on installing and configuring a proxy page see Using a proxy page.

For addtional customization options view the wiki.

#Requirements

  • Notepad or HTML editor
  • Some background with HTML, CSS and JavaScript
  • Experience with the ArcGIS API for JavaScript is helpful.

#Resources

#Issues Found 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 Online Web Application Templates) [](Esri Language: JavaScript)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.1%
  • CSS 19.9%