├── .gitignore ├── .jshintrc ├── .nojekyll ├── DnD ├── .jshintrc ├── DnD.js ├── DnD │ ├── DroppedItem.js │ ├── css │ │ ├── DnD.css │ │ └── DroppedItem.css │ ├── images │ │ ├── database.png │ │ ├── earth.png │ │ ├── folder.png │ │ ├── images.png │ │ ├── loading.gif │ │ ├── map.png │ │ ├── remove.png │ │ └── warning.png │ └── templates │ │ ├── DnD.html │ │ └── DroppedItem.html ├── README.md ├── sampledata │ ├── Sample_Points.zip │ ├── Sample_Polygon.zip │ ├── Sample_Polyline.zip │ ├── blue.png │ ├── cctv.kml │ └── earthquakes.csv └── screenshot.png ├── Goto ├── .jshintrc ├── Goto.js ├── Goto │ ├── CoordTypes.js │ ├── css │ │ └── Goto.css │ ├── images │ │ ├── icon.js │ │ └── iconsprite.png │ └── templates │ │ └── Goto.html ├── README.md └── screenshot.png ├── LICENSE ├── MapNavigationHash ├── MapNavigationHash.js ├── README.md └── screenshot.png ├── Nearby ├── .jshintrc ├── Nearby.js ├── Nearby │ ├── css │ │ └── Nearby.css │ ├── images │ │ ├── crosshairs.png │ │ ├── dock.png │ │ ├── loading.gif │ │ └── undock.png │ └── templates │ │ └── Nearby.html ├── README.md ├── _SelectionLayersMixin.js └── screenshot.png ├── README.md ├── css └── main.css ├── images ├── close.png ├── esri-logo.png ├── linen.jpg ├── loading.gif ├── noisy_grid.png ├── noisy_grid_dark.png ├── open.png ├── pointertop.png └── rocket-logo.png ├── index.html ├── js ├── config │ ├── basemaps.js │ ├── bookmarks.js │ ├── find.js │ ├── identify.js │ └── viewer.js ├── dbootstrap │ ├── main.js │ ├── package.json │ └── theme │ │ └── dbootstrap │ │ ├── dbootstrap.css │ │ ├── dijit.css │ │ └── font │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff ├── gis │ ├── dijit │ │ ├── Basemaps.js │ │ ├── Basemaps │ │ │ ├── css │ │ │ │ └── Basemaps.css │ │ │ ├── images │ │ │ │ ├── check.png │ │ │ │ └── clear.png │ │ │ └── templates │ │ │ │ └── Basemaps.html │ │ ├── Bookmarks.js │ │ ├── Bookmarks │ │ │ └── css │ │ │ │ └── Bookmarks.css │ │ ├── Directions.js │ │ ├── Directions │ │ │ └── templates │ │ │ │ └── Directions.html │ │ ├── Draw.js │ │ ├── Draw │ │ │ ├── css │ │ │ │ └── Draw.css │ │ │ ├── images │ │ │ │ ├── clear.png │ │ │ │ └── toolbar_icons.png │ │ │ └── templates │ │ │ │ └── Draw.html │ │ ├── Editor.js │ │ ├── Find.js │ │ ├── Find │ │ │ ├── css │ │ │ │ └── Find.css │ │ │ ├── images │ │ │ │ ├── clear.png │ │ │ │ └── search.png │ │ │ └── templates │ │ │ │ └── Find.html │ │ ├── FloatingTitlePane.js │ │ ├── FloatingTitlePane │ │ │ └── css │ │ │ │ └── FloatingTitlePane.css │ │ ├── FloatingWidgetDialog.js │ │ ├── Geocoder.js │ │ ├── Geocoder │ │ │ ├── css │ │ │ │ └── Geocoder.css │ │ │ ├── images │ │ │ │ ├── geocoder.png │ │ │ │ └── loading.gif │ │ │ └── templates │ │ │ │ └── Geocoder.html │ │ ├── Growler.js │ │ ├── Growler │ │ │ └── css │ │ │ │ └── Growler.css │ │ ├── Help.js │ │ ├── Help │ │ │ ├── css │ │ │ │ └── Help.css │ │ │ ├── images │ │ │ │ └── help.png │ │ │ └── templates │ │ │ │ └── HelpDialog.html │ │ ├── Identify.js │ │ ├── Identify │ │ │ ├── css │ │ │ │ └── Identify.css │ │ │ ├── images │ │ │ │ ├── identify.png │ │ │ │ └── loading.gif │ │ │ └── templates │ │ │ │ └── Identify.html │ │ ├── LayerControl.js │ │ ├── LayerControl │ │ │ ├── README.md │ │ │ ├── controls │ │ │ │ ├── Dynamic.js │ │ │ │ ├── DynamicFolder.js │ │ │ │ ├── DynamicSublayer.js │ │ │ │ ├── Feature.js │ │ │ │ ├── Image.js │ │ │ │ ├── Tiled.js │ │ │ │ └── templates │ │ │ │ │ ├── Control.html │ │ │ │ │ ├── Folder.html │ │ │ │ │ └── Sublayer.html │ │ │ ├── css │ │ │ │ └── LayerControl.css │ │ │ └── plugins │ │ │ │ ├── LayerMenu.js │ │ │ │ ├── Transparency.js │ │ │ │ └── legendUtil.js │ │ ├── LocateButton.js │ │ ├── MapInfo.js │ │ ├── MapInfo │ │ │ └── css │ │ │ │ └── MapInfo.css │ │ ├── Measurement.js │ │ ├── Print.js │ │ ├── Print │ │ │ ├── css │ │ │ │ └── Print.css │ │ │ ├── images │ │ │ │ ├── clear.png │ │ │ │ ├── image.png │ │ │ │ ├── pdf.png │ │ │ │ ├── print.png │ │ │ │ └── settings.png │ │ │ └── templates │ │ │ │ ├── Print.html │ │ │ │ └── PrintResult.html │ │ ├── StreetView.js │ │ ├── StreetView │ │ │ ├── css │ │ │ │ └── StreetView.css │ │ │ ├── images │ │ │ │ ├── blueArrow.png │ │ │ │ ├── googleIcon.png │ │ │ │ ├── loading.gif │ │ │ │ └── svicon.png │ │ │ └── templates │ │ │ │ └── StreetView.html │ │ ├── TOC.js │ │ ├── TOC │ │ │ ├── css │ │ │ │ └── TOC.css │ │ │ ├── images │ │ │ │ └── treeExpandImages.png │ │ │ └── templates │ │ │ │ └── tocNode.html │ │ ├── Vim.js │ │ └── _FloatingWidgetMixin.js │ └── plugins │ │ └── async.js └── viewer │ ├── Controller.js │ ├── dijit │ ├── DnD │ │ ├── DnD.js │ │ └── DnD │ │ │ ├── DroppedItem.js │ │ │ ├── css │ │ │ ├── DnD.css │ │ │ └── DroppedItem.css │ │ │ ├── images │ │ │ ├── database.png │ │ │ ├── earth.png │ │ │ ├── folder.png │ │ │ ├── images.png │ │ │ ├── loading.gif │ │ │ ├── map.png │ │ │ ├── remove.png │ │ │ └── warning.png │ │ │ └── templates │ │ │ ├── DnD.html │ │ │ └── DroppedItem.html │ ├── Goto │ │ ├── Goto.js │ │ └── Goto │ │ │ ├── css │ │ │ └── Goto.css │ │ │ ├── images │ │ │ └── iconsprite.png │ │ │ └── templates │ │ │ └── Goto.html │ ├── MapNavigationHash │ │ └── MapNavigationHash.js │ └── Nearby │ │ ├── Nearby.js │ │ ├── Nearby │ │ ├── css │ │ │ └── Nearby.css │ │ ├── images │ │ │ ├── crosshairs.png │ │ │ ├── dock.png │ │ │ ├── loading.gif │ │ │ └── undock.png │ │ └── templates │ │ │ └── Nearby.html │ │ └── _SelectionLayersMixin.js │ └── templates │ ├── leftContent.html │ └── mapOverlay.html └── proxy ├── PROXY_README.md ├── Web.config ├── proxy.ashx ├── proxy.config ├── proxy.xsd └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | # Logs 3 | logs 4 | *.log 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # Compiled binary addons (http://nodejs.org/api/addons.html) 21 | build/Release 22 | 23 | # Dependency directory 24 | # Deployed apps should consider commenting this line out: 25 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 26 | node_modules 27 | /nbproject/private/ -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | // JSHint Configuration, esri jsapi 3 | // Modified from [jshint web defaults][1]. 4 | // Differences between the default and our file are noted 5 | // Options that are commented out completely are uneccesary or problematic for our codebase 6 | // [1] : https://github.com/jshint/jshint/blob/2.x/examples/.jshintrc 7 | // See http://jshint.com/docs/ for more details 8 | 9 | "maxerr" : 5000, // {int} Maximum error before stopping ** Get ALL the errors ** 10 | 11 | // Enforcing - true = enforce this rule, false = don't enforce this rule 12 | "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) 13 | "camelcase" : false, // true: Identifiers must be in camelCase 14 | "curly" : true, // true: Require {} for every new block or scope 15 | "eqeqeq" : false, // true: Require triple equals (===) for comparison ** Just use triples with undefined, null, false, 0 and 1 ** 16 | "es3" : true, // true: Adhere to ECMAScript 3 specification ** Still needed until IE8 support is dropped ** 17 | "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() ** Still needed until IE8 support is dropped ** 18 | "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` ** Avoids confusion and minification errors ** 19 | "latedef" : false, // true: Require variables/functions to be defined before being used 20 | "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` ** Coding style enforcement ** 21 | "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` 22 | "noempty" : true, // true: Prohibit use of empty blocks 23 | "nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment) ** Coding style enforcement ** 24 | "plusplus" : false, // true: Prohibit use of `++` & `--` 25 | "quotmark" : "single", // Quotation mark consistency: ** Use the same style. Doubles should be used in most cases ** 26 | // false : do nothing (default) 27 | // true : ensure whatever is used is consistent 28 | // "single" : require single quotes 29 | // "double" : require double quotes 30 | "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) 31 | "unused" : "strict", // true: Require all defined variables be used 32 | "strict" : false, // true: Requires all functions run in ES5 Strict Mode ** Dojo style and existing codebase conflicts ** 33 | "trailing" : false, // true: Prohibit trailing whitespaces 34 | //"indent" : 4, // {int} Number of spaces to use for indentation 35 | //"maxparams" : false, // {int} Max number of formal params allowed per function 36 | //"maxdepth" : false, // {int} Max depth of nested blocks (within functions) 37 | //"maxstatements" : false, // {int} Max number statements per function 38 | //"maxcomplexity" : false, // {int} Max cyclomatic complexity per function 39 | //"maxlen" : false, // {int} Max number of characters per line 40 | 41 | // Relaxing - false = continue to enforce this rule, true = don't enforce this rule (relax it) 42 | "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) 43 | "boss" : false, // true: Tolerate assignments where comparisons would be expected 44 | "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. 45 | "eqnull" : true, // true: Tolerate use of `== null` 46 | "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) 47 | "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) 48 | "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) 49 | // (ex: `for each`, multiple try/catch, function expression…) 50 | "evil" : false, // true: Tolerate use of `eval` and `new Function()` 51 | "expr" : false, // true: Tolerate `ExpressionStatement` as Programs 52 | "funcscope" : true, // true: Tolerate defining variables inside control statements ** Other variable checks keep use from abusing this ** 53 | "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') 54 | "iterator" : false, // true: Tolerate using the `__iterator__` property 55 | "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block 56 | "laxbreak" : false, // true: Tolerate possibly unsafe line breakings 57 | "laxcomma" : false, // true: Tolerate comma-first style coding 58 | "loopfunc" : true, // true: Tolerate functions being defined in loops ** Almost required in some callback & promise style code ** 59 | "multistr" : false, // true: Tolerate multi-line strings 60 | "proto" : false, // true: Tolerate using the `__proto__` property 61 | "scripturl" : true, // true: Tolerate script-targeted URLs ** If this is being used, there is probably a good reason ** 62 | "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment 63 | "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` 64 | "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation 65 | "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` 66 | "validthis" : true, // true: Tolerate using this in a non-constructor function ** We don't run in `strict mode` & coding style conflicts ** 67 | 68 | // Environments 69 | "browser" : true, // Web Browser (window, document, etc) 70 | "devel" : true, // Development/debugging (alert, confirm, etc) 71 | "couch" : false, // CouchDB 72 | "dojo" : false, // Dojo Toolkit ** Don't use global dojo objects. Use AMD style coding ** 73 | "jquery" : false, // jQuery 74 | "mootools" : false, // MooTools 75 | "node" : false, // Node.js 76 | "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) 77 | "prototypejs" : false, // Prototype and Scriptaculous 78 | "rhino" : false, // Rhino 79 | "worker" : false, // Web Workers ** Make a jshint comment when this is `true` ** 80 | "wsh" : false, // Windows Scripting Host 81 | "yui" : false, // Yahoo User Interface 82 | 83 | // Legacy ** According to jshint docs, these options are NOT to be used or relied on. Removing them. 84 | //"nomen" : false, // true: Prohibit dangling `_` in variables 85 | //"onevar" : false, // true: Allow only one `var` statement per function 86 | //"passfail" : false, // true: Stop on first error 87 | //"white" : false, // true: Check against strict whitespace and indentation rules 88 | 89 | // Custom Globals - additional predefined global variables 90 | // Using both `predef` and `globals` to support tools with older jshint parsers 91 | "predef" : [ 92 | "define", 93 | "require" 94 | ], 95 | "globals" : { // ** `false` = don't allow variable to be redefined locally 96 | "define": false, 97 | "require": false 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/.nojekyll -------------------------------------------------------------------------------- /DnD/DnD/css/DnD.css: -------------------------------------------------------------------------------- 1 | .esri-DnD { 2 | position: relative; 3 | } 4 | 5 | .esri-DnD .instructions { 6 | border: 1px dashed #666; 7 | padding: 5px; 8 | margin: 2px; 9 | } 10 | 11 | .esri-DnD-target { 12 | background-color: rgba(0,0,0,.25); 13 | position: absolute; 14 | top: 0; 15 | width: 100%; 16 | z-index: 1000; 17 | } 18 | 19 | .esri-DnD .alert-info { 20 | background-color: #fcf8e3; 21 | color: #c09853; 22 | border: 1px dashed #c09853; 23 | padding: 5px; 24 | } 25 | 26 | .esri-DnD .off { 27 | display: none; 28 | } 29 | 30 | .esri-DnD .manualResourceAdd { 31 | color:#333; 32 | padding:.1em .1em .1em .3em; 33 | background:#f7f7f7; 34 | border:1px solid #ccc; 35 | margin: 2px; 36 | } 37 | 38 | .esri-DnD .manualResourceAdd .fileInput { 39 | background: white; 40 | box-shadow: inset 0 0 0 1px #cfcfcf; 41 | } 42 | 43 | .esri-DnD .manualResourceAdd .serviceUrlInput { 44 | border: 1px solid #cfcfcf; 45 | height: 18px; 46 | } -------------------------------------------------------------------------------- /DnD/DnD/css/DroppedItem.css: -------------------------------------------------------------------------------- 1 | .esri-DroppedItem { 2 | border: 1px solid #666666; 3 | margin: 2px; 4 | padding: 4px; 5 | } 6 | 7 | .esri-DroppedItem .iconNode { 8 | width: 32px; 9 | height: 32px; 10 | display: inline-block; 11 | float: left; 12 | } 13 | 14 | .esri-DroppedItem .labelNode { 15 | display: inline-block; 16 | line-height: 32px; 17 | float: left; 18 | overflow-x: hidden; 19 | text-overflow: ellipsis; 20 | } 21 | 22 | .esri-DroppedItem .removeNode { 23 | display: inline-block; 24 | float: right; 25 | cursor: pointer; 26 | } 27 | 28 | .esri-DroppedItem .labelNode .sub-label { 29 | font-size: 80%; 30 | color: #777; 31 | } 32 | 33 | .esri-DroppedItem .containerNode { 34 | padding-left: 35px; 35 | max-height: 250px; 36 | overflow-y: auto; 37 | overflow-x: hidden; 38 | } 39 | 40 | .esri-DroppedItem .clearer { 41 | clear: both; 42 | } 43 | 44 | .esri-DroppedItem .layerTitle { 45 | font-style: oblique; 46 | } 47 | 48 | .esri-DroppedItem .layerInfo { 49 | padding-left: 5px; 50 | } 51 | -------------------------------------------------------------------------------- /DnD/DnD/images/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/database.png -------------------------------------------------------------------------------- /DnD/DnD/images/earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/earth.png -------------------------------------------------------------------------------- /DnD/DnD/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/folder.png -------------------------------------------------------------------------------- /DnD/DnD/images/images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/images.png -------------------------------------------------------------------------------- /DnD/DnD/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/loading.gif -------------------------------------------------------------------------------- /DnD/DnD/images/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/map.png -------------------------------------------------------------------------------- /DnD/DnD/images/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/remove.png -------------------------------------------------------------------------------- /DnD/DnD/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/DnD/images/warning.png -------------------------------------------------------------------------------- /DnD/DnD/templates/DnD.html: -------------------------------------------------------------------------------- 1 |
2 |
Drag-and-drop KML files, CSV files, shapefiles, or service urls here or onto the map
3 |
4 | The browser you are using does not support drag-and-drop functionality. Try newer versions of Chrome or Firefox if possible. 5 |
6 |
7 |
8 | 9 | or Service url 10 | 11 | 12 |
13 |
-------------------------------------------------------------------------------- /DnD/DnD/templates/DroppedItem.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
${label}
4 |
5 | 6 |
7 |
8 |
-------------------------------------------------------------------------------- /DnD/README.md: -------------------------------------------------------------------------------- 1 | Drag and Drop Widget 2 | ================= 3 | Drag-and-Drop widget for the js api. Adapted from [Drag and drop to display data](https://developers.arcgis.com/javascript/jssamples/exp_dragdrop.html) sample. 4 | 5 | 6 | ```javascript 7 | dnd: { 8 | include: true, 9 | id: 'dnd', 10 | type: 'titlePane', 11 | canFloat: true, 12 | path: 'gis/dijit/DnD', 13 | title: 'Drag and Drop', 14 | options: { 15 | map: true 16 | } 17 | } 18 | ``` 19 | Available drag-and-drop sources: 20 | - CSV 21 | - KML 22 | - Shapefile (see [Best Practices](http://doc.arcgis.com/en/arcgis-online/reference/shapefiles.htm#ESRI_SECTION2_913CE2DFA59845C2926B2842F3AB8D66), adapted from [Add shapefile](https://developers.arcgis.com/javascript/jssamples/portal_addshapefile.html) sample) 23 | - Image 24 | - Text (highlight url and drag-and-drop) 25 | - MapServer (http://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer) 26 | - MapServer Layer (http://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/MapServer/0) 27 | - FeatureServer Layer (http://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/2) 28 | - ImageServer (http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer) 29 | 30 | Note: doesn't currently support DnD of FeatureServer root directory text (http://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer). 31 | 32 | 33 | [Click for demo](http://brianbunker.github.io/cmv-widgets/) 34 | 35 | **NOTE**: A proxy page may be required for some files like KML due to the arcgis.com conversion service used. 36 | A proxy is not available for the Github demo. 37 | 38 | [Download demo csv, kml, shapefiles, and image](./sampledata) 39 | 40 | Screen from Sample page: 41 | 42 | ![Screenshot](./screenshot.png) 43 | 44 | 45 | TODO 46 | ==== 47 | - Support for Image urls (problematic because url doesn't necessarily have file extension and need to request image/convert to base64) 48 | - Add multiple files to the map at once 49 | -------------------------------------------------------------------------------- /DnD/sampledata/Sample_Points.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/sampledata/Sample_Points.zip -------------------------------------------------------------------------------- /DnD/sampledata/Sample_Polygon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/sampledata/Sample_Polygon.zip -------------------------------------------------------------------------------- /DnD/sampledata/Sample_Polyline.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/sampledata/Sample_Polyline.zip -------------------------------------------------------------------------------- /DnD/sampledata/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/sampledata/blue.png -------------------------------------------------------------------------------- /DnD/sampledata/earthquakes.csv: -------------------------------------------------------------------------------- 1 | Src,Eqid,Version,Datetime,Lat,Lon,Magnitude,Depth,NST,Region 2 | ak,10333559,1,"Wednesday, October 12, 2011 16:58:42 UTC",58.8078,-152.1652,2.3,31.00,12,"Kodiak Island region, Alaska" 3 | se,101211e,A,"Wednesday, October 12, 2011 16:40:00 UTC",37.9411,-77.9807,2.6,3.80,15,"Virginia" 4 | nn,00351018,8,"Wednesday, October 12, 2011 16:24:58 UTC",36.0833,-114.7633,2.0,5.20,17,"Nevada" 5 | nm,101211d,A,"Wednesday, October 12, 2011 16:18:53 UTC",35.3574,-92.2537,2.1,3.60,11,"Arkansas" 6 | -------------------------------------------------------------------------------- /DnD/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/DnD/screenshot.png -------------------------------------------------------------------------------- /Goto/Goto.js: -------------------------------------------------------------------------------- 1 | define([ 2 | // basics 3 | 'dojo/_base/declare', 4 | 'dojo/_base/lang', 5 | 'dojo/_base/array', 6 | 7 | 'dojo/on', 8 | 'dojo/keys', 9 | 10 | 'dijit/TooltipDialog', 11 | 'dijit/popup', 12 | 13 | 'put-selector', 14 | 15 | // mixins & base classes 16 | 'dijit/_WidgetBase', 17 | 'dijit/_TemplatedMixin', 18 | 'dijit/_WidgetsInTemplateMixin', 19 | 20 | // default coord types 21 | './Goto/CoordTypes', 22 | 23 | //store for select 24 | 'dojo/data/ObjectStore', 25 | 'dojo/store/Memory', 26 | 27 | //graphics layer 28 | 'esri/graphic', 29 | 'esri/geometry/Point', 30 | 'esri/SpatialReference', 31 | './Goto/images/icon', 32 | 'esri/symbols/PictureMarkerSymbol', 33 | 34 | // templates & widget css 35 | 'dojo/text!./Goto/templates/Goto.html', 36 | 'xstyle/css!./Goto/css/Goto.css', 37 | 38 | // not referenced 39 | 'dijit/form/Button', 40 | 'dijit/form/TextBox', 41 | 'dijit/form/Select' 42 | ], function( 43 | declare, lang, array, 44 | on, keys, 45 | TooltipDialog, popup, 46 | put, 47 | _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, 48 | CoordTypes, ObjectStore, Memory, 49 | Graphic, Point, SpatialReference, icon, PictureMarkerSymbol, 50 | template 51 | ) { 52 | 53 | return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { 54 | widgetsInTemplate: true, 55 | templateString: template, 56 | baseClass: 'gis_GotoDijit', 57 | graphicCoordinate: null, 58 | _setGraphicCoordinateAttr: function(coordinate) { 59 | this.graphicCoordinate = coordinate; 60 | if (coordinate) { 61 | var point = new Point(coordinate, new SpatialReference({ 62 | wkid: 4326 63 | })); 64 | this.graphic.setGeometry(point); 65 | this.graphic.show(); 66 | } else { 67 | this.graphic.hide(); 68 | } 69 | }, 70 | defaultCoordTypes: CoordTypes, 71 | useDefault: true, 72 | coordTypes: [], 73 | coordStore: null, 74 | postMixInProperties: function() { 75 | this.inherited(arguments); 76 | this.setCoordStore(); 77 | }, 78 | postCreate: function() { 79 | this.inherited(arguments); 80 | this.setCoordStore(); 81 | this.setupConnections(); 82 | this.initGraphics(); 83 | }, 84 | setCoordStore: function() { 85 | if (this.useDefault) { 86 | this.coordTypes = this.defaultCoordTypes.concat(this.coordTypes); 87 | } 88 | var store = new Memory({ 89 | data: this.coordTypes 90 | }); 91 | this.coordStore = new ObjectStore({ 92 | objectStore: store 93 | }); 94 | }, 95 | setupConnections: function() { 96 | this.helpTooltip = new TooltipDialog({ 97 | id: this.baseClass + '_helpTooltip', 98 | style: 'width: 300px;', 99 | content: '', 100 | onBlur: lang.hitch(this, function() { 101 | popup.close(this.helpTooltip); 102 | }) 103 | }); 104 | on(this.questionIconNode, 'click', lang.hitch(this, 'showCoordHelp')); 105 | this.gotoTypeSelect.on('change', lang.hitch(this, 'updateForm')); 106 | this.coordinateTextBox.on('keypress', lang.hitch(this, 'handleCoordInput')); 107 | this.goButton.on('click', lang.hitch(this, 'gotoCoordinate')); 108 | }, 109 | initGraphics: function() { 110 | var symbol = new PictureMarkerSymbol(icon.url, 32, 32); 111 | symbol.setOffset(0, 20); 112 | this.graphic = new Graphic(); 113 | this.graphic.setSymbol(symbol); 114 | this.map.graphics.add(this.graphic); 115 | }, 116 | updateForm: function() { 117 | var coordTypeDisplay = this.gotoTypeSelect.get('displayedValue'); 118 | var coordType = this.getCoordinateType(); 119 | 120 | this.coordinateTextBox.set('value', coordType.default || ''); 121 | this.coordinateHintNode.innerHTML = coordTypeDisplay + ' ' + (coordType.examples && coordType.examples.length ? coordType.examples[0] : ''); 122 | }, 123 | showCoordHelp: function() { 124 | var coordType = this.getCoordinateType(); 125 | var helpString = '

' + (coordType.helpText ? coordType.helpText : '') + '

'; 130 | this.helpTooltip.set('content', helpString); 131 | popup.open({ 132 | popup: this.helpTooltip, 133 | around: this.questionIconNode 134 | }); 135 | this.helpTooltip.focus(); 136 | }, 137 | handleCoordInput: function(evt) { 138 | if (evt.charOrCode === keys.ENTER) { 139 | this.gotoCoordinate(); 140 | return; 141 | } 142 | }, 143 | gotoCoordinate: function() { 144 | var inputCoord = this.coordinateTextBox.get('value'); 145 | var latlongCoord = this.determineLatLongFromCoordinate(inputCoord); 146 | if (latlongCoord && !isNaN(latlongCoord[0]) && !isNaN(latlongCoord[1])) { 147 | this.map.centerAt(latlongCoord); 148 | this.set('graphicCoordinate', latlongCoord); 149 | } else { 150 | this.set('graphicCoordinate', null); 151 | } 152 | }, 153 | determineLatLongFromCoordinate: function(inputCoord) { 154 | if (!inputCoord) { 155 | return null; 156 | } 157 | var coordType = this.getCoordinateType(); 158 | return coordType ? coordType.toLatLong(inputCoord) : null; 159 | }, 160 | getCoordinateType: function() { 161 | var key = this.gotoTypeSelect.get('value'); 162 | return array.filter(this.coordTypes, lang.hitch(this, function(coord) { 163 | return coord.id === key; 164 | }))[0] || {}; 165 | } 166 | }); 167 | }); 168 | -------------------------------------------------------------------------------- /Goto/Goto/CoordTypes.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'proj4js/proj4', 3 | 'dojo/topic' 4 | ], function (proj4, topic) { 5 | return [{ 6 | id: 'latlon', 7 | label: 'Latitude/Longitude', 8 | examples: ['-100.1234 30.1234', '118°44\'24.844\" W 35°33\'34.36\" N', '46:24:37.613N 9:25:59.067E'], 9 | helpText: 'The input accepts longitude first, then latitude in Decimal degrees (DD) or Degrees, Minutes, Seconds (DMS) formats. Hemisphere designation (NSEW) are optional. The coordinate parts may be separated by spaces, colons, or conventional markup (°, \', and ").', 10 | toLatLong: function (inputCoord) { 11 | var latLon = null; 12 | latLon = this.parseDms(inputCoord); 13 | if (latLon.length === 2) { 14 | return latLon; 15 | } 16 | latLon = this.parseDec(inputCoord); 17 | if (latLon.length === 2) { 18 | return latLon; 19 | } 20 | return null; 21 | }, 22 | parseDec: function (decStr) { 23 | var decRe = /(-?\d+(?:\.\d+))[°,]?([NSEW])?/gi; 24 | var output = [], 25 | decMatch, degrees, hemisphere; 26 | while ((decMatch = decRe.exec(decStr)) !== null) { 27 | degrees = Number(decMatch[1]); 28 | hemisphere = decMatch[2] || null; 29 | if (hemisphere !== null && (/[SW]/i).test(hemisphere)) { 30 | degrees = Math.abs(degrees) * -1; 31 | } 32 | output.push(degrees); 33 | } 34 | return output; 35 | }, 36 | parseDms: function (dmsStr) { 37 | /** Parses a Degrees Minutes Seconds string into a Decimal Degrees number. 38 | * Created by Jeff Jacobson (http://github.com/JeffJacobson) http://gist.github.com/JeffJacobson/2955437 39 | * Modified by Brian Bunker, Esri Inc., 9/25/2014, 3:27 pm, while eating grapes 40 | * @param {string} dmsStr A string containing a coordinate in either DMS or DD format. 41 | * @return {Array} If dmsStr is a valid coordinate string, an array of value in decimal degrees will be 42 | * returned (matching all instances in the input string). Otherwise NaN will be returned. 43 | */ 44 | // Matches DMS coordinates 45 | var dmsRe = /(-?\d+(?:\.\d+)?)[°:d]?\s?(?:(\d+(?:\.\d+)?)['′:]?\s?(?:(\d+(?:\.\d+)?)["″]?)?)?\s?([NSEW])?/gi; 46 | // Results of match will be [full coords string, Degrees, minutes (if any), seconds (if any), hemisphere (if any)] 47 | // E.g., ["40:26:46.302N", "40", "26", "46.302", "N"] 48 | // E.g., ["40.446195N", "40.446195", undefined, undefined, "N"] 49 | var output = [], 50 | dmsMatch, degrees, minutes, seconds, hemisphere; 51 | while ((dmsMatch = dmsRe.exec(dmsStr)) !== null) { 52 | degrees = Number(dmsMatch[1]); 53 | 54 | minutes = typeof(dmsMatch[2]) !== 'undefined' ? Number(dmsMatch[2]) / 60 : 0; 55 | seconds = typeof(dmsMatch[3]) !== 'undefined' ? Number(dmsMatch[3]) / 3600 : 0; 56 | hemisphere = dmsMatch[4] || null; 57 | if (hemisphere !== null && (/[SW]/i).test(hemisphere)) { 58 | degrees = Math.abs(degrees) * -1; 59 | } 60 | if (degrees < 0) { 61 | output.push(degrees - minutes - seconds); 62 | } else { 63 | output.push(degrees + minutes + seconds); 64 | } 65 | } 66 | return output; 67 | } 68 | }, { 69 | id: 'utm', 70 | label: 'UTM', 71 | examples: ['767882.527 E 4001950.654 N Zone 16N', '665539.235E 5876246.228N 51S'], 72 | helpText: 'The input accepts Northing or Easting first, but coordinate designation letter is mandatory (NE). The word "Zone" is optional. The hemisphere designation (NS) is optional and defaults to N.', 73 | toLatLong: function (dmsStr) { 74 | var utmRe = /(-?\d+(?:\.\d+))\s*([NE])\s*(-?\d+(?:\.\d+))\s*([NE])\s+(?:ZONE)?\s?(\d{1,2})\s*([NS])?/gi; 75 | var output = [], 76 | utmMatch, northing, easting, zoneNum, hemisphere; 77 | while ((utmMatch = utmRe.exec(dmsStr)) !== null) { 78 | if (/[N]/i.test(utmMatch[2])) { 79 | northing = utmMatch[1]; 80 | } else if (/[E]/i.test(utmMatch[2])) { 81 | easting = utmMatch[1]; 82 | } 83 | if (/[N]/i.test(utmMatch[4])) { 84 | northing = utmMatch[3]; 85 | } else if (/[E]/i.test(utmMatch[4])) { 86 | easting = utmMatch[3]; 87 | } 88 | zoneNum = utmMatch[5]; 89 | hemisphere = (/[S]/i.test(utmMatch[6]) ? ' +south' : ''); 90 | output = this.projectUTMToLatLong(northing, easting, zoneNum, hemisphere); 91 | } 92 | return output; 93 | }, 94 | projectUTMToLatLong: function (northing, easting, zone, hemisphere) { 95 | var utmProj = '+proj=utm +zone=' + String(zone) + hemisphere + ' +ellps=WGS84 +datum=WGS84 +units=m +no_defs'; 96 | var geoProj = proj4.defs('WGS84'); 97 | return proj4(utmProj, geoProj, [easting, northing]); 98 | } 99 | }, { 100 | id: 'mgrs', 101 | label: 'US National Grid/MGRS', 102 | //default: '15TVK', 103 | examples: ['4QFJ123456', '14SMF6373224867', '10UFD30'], 104 | helpText: 'The input accepts a grid zone designator (4Q), grid square id (FJ), and an even number of additional precision numbers (12345678). See wikipedia entry for additional info.', 105 | toLatLong: function (inputCoord) { 106 | try { 107 | return proj4.mgrs.toPoint(inputCoord); 108 | } catch (e) { 109 | topic.publish('growler/growl', { 110 | title: 'Error', 111 | message: e, 112 | level: 'warning' 113 | }); 114 | } 115 | } 116 | }]; 117 | }); 118 | -------------------------------------------------------------------------------- /Goto/Goto/css/Goto.css: -------------------------------------------------------------------------------- 1 | .gis_GotoDijit .coordinateHint { 2 | font-size: 80%; 3 | font-style: italic; 4 | color: #aaa; 5 | } 6 | 7 | .gis_GotoDijit .questionIcon { 8 | background-image: url('../images/iconsprite.png'); 9 | background-position: -14px 0; 10 | background-size: 25px 10px; 11 | width: 10px; 12 | height: 10px; 13 | display: inline-block; 14 | margin: 0 2px; 15 | cursor: pointer; 16 | } -------------------------------------------------------------------------------- /Goto/Goto/images/icon.js: -------------------------------------------------------------------------------- 1 | define({ 2 | url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIJEDkiGprC5gAAA8pJREFUWMO9l8FPHHUUxz9vZtldcMtSWq1Dm5pA9GCwmtZEXcbQVo2xjOiRpAc10ZjU6EXqH8DN2F40emg89Nibtk6bSEgLYbI91WjCDbRtjLsQhAJSWGZ35ucBdpnZ7MrOQv0lm+zvzfze9/v7vvd+vzdCxJG3zA+BQeAF4NCWeQ74Fbhm2M73UfzJTi/8ZWU4bGfJW+YXwJcN+j1v2M6FnGXSZTvNE8hbGVZY09tJ/QIciyjWb4VlTiT34Rk36pPQ6oP3wWRK2kndqwWuiYR+NcbzyTT33jpSYtZ6tVkFzDHgtaBNAQtr66y4Lm7JAyAR09kXT3CwLVnLzahhO29GIjD3rolXUpYgPwXthZLH/eWV/9T9qXQ7yZheZVUD6652o3t0snEF8pY5A/SU5xuex90Hy8i23D4wpjadvF4Op0LR3ZEmrodITBu280zDCuQG+npEZCYY7+nFJUq+XzZ925+d+iS4ZiLT+x1wDiCmaTzd2YGvFAG23Ydt5+6OSbhw+hSIDARt/7guRa8C/kM1OEB/duoc8CNA0fNZdd2qnaqB34dO7lwFB27eQuC5oO2hWySQ6Ofrhc2HYQARWC2WqgjIsZ4r4w2XYWcwRgHp6c9OzdQjcCrwrOT51fHtjHIObFTXfNShiaDCpkIEAmo6WPfJlljlyXim9/N6oBOZ3uHy/9aWcCkqxUzDBJSSW8F5RyJR2Y3AxfFXnj1evWY803sCuFAmnU4kwjkg6makkzBvmUWgsvUHhQ3mHq4FF1xRKHtzLhYwVAY/9Fgb+5MhAq5hO4laOLF6BJRSIyIyUsmg1iRFz2NhvVDOiSFBhkJVoBQHWpN0tiZRKpQBI83eBUtAeltGWHWLzK6u4Xpe5VRUShHXdZ5MtZGKtxDGZsmwnf2RCSy+f5rCvDsowtVaGe56Hhve1mWk68R1PXTybavC2+mYbqeuTjTXkOQt8w5wnObGHcN2Xmy6IclZJii/R0SbaQZdoXpA/dFlZ5tvybZUuAy8FxH/smE7H+y6J8wNmsQKetyLextR0P1iKa4SWvHItezuCFRUGOgbRuSrBrUfNq47F/ekK64KxTxwcIfX/jZs5/GG74wICgDq7M67V2dn3zm5d98FNVS4Dbxc5/Ftw3Yye/phEkrIMyai+UdBu1979/5RhfZn13Xn0SmweT70XRLko6p2/VKX7Xwc1VdkAvODGRbXS3p7Ih7quZZXSnpna4v/xM+Tj5bAdudsfirC11vTzwzb+Yb/e+QtM5e3zNxufDStQP7MSyCxNxAUrjZmjE425edfDUNSsLPhkW8AAAAASUVORK5CYII=' 3 | }); 4 | -------------------------------------------------------------------------------- /Goto/Goto/images/iconsprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/Goto/Goto/images/iconsprite.png -------------------------------------------------------------------------------- /Goto/Goto/templates/Goto.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | Longitude/Latitude -100.1234 30.1234 13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /Goto/README.md: -------------------------------------------------------------------------------- 1 | Goto Widget 2 | ================= 3 | Goto widget for the esri js api. Accepts longitude/latitude, UTM, and MGRS coordinates. 4 | 5 | Longitude/Latitude 6 | ------------------ 7 | The input accepts longitude first, then latitude in Decimal degrees (DD) or Degrees, Minutes, Seconds (DMS) formats. Hemisphere designation (NSEW) are optional. The coordinate parts may be separated by spaces, colons, or conventional markup (°, \', and "). 8 | 9 | UTM 10 | --- 11 | The input accepts Northing or Easting first, but coordinate designation letter is mandatory (NE). The word "Zone" is optional. The hemisphere designation (NS) is optional and defaults to N. 12 | 13 | MGRS 14 | ---- 15 | The input accepts a grid zone designator (4Q), grid square id (FJ), and an even number of additional precision numbers (12345678). See wikipedia entry on [Military Grid Reference System](http://en.wikipedia.org/wiki/Military_grid_reference_system) for additional info. 16 | 17 | 18 | Use by adding the following to viewer.js config file. 19 | ```javascript 20 | gotocoord: { 21 | include: true, 22 | id: 'goto', 23 | type: 'titlePane', 24 | canFloat: true, 25 | path: 'gis/dijit/Goto', 26 | title: 'Go To Coordinate', 27 | options: { 28 | map: true 29 | } 30 | } 31 | ``` 32 | 33 | [Click for demo](http://brianbunker.github.com/dojo-esri-goto-widget) 34 | 35 | Screen from Sample page: 36 | 37 | ![Screenshot](./screenshot.png) 38 | -------------------------------------------------------------------------------- /Goto/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/Goto/screenshot.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 David Spriggs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MapNavigationHash/MapNavigationHash.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 5 | 'dojo/router', 6 | 'dojo/hash', 7 | 'dojo/on', 8 | 9 | 'esri/geometry/webMercatorUtils', 10 | 11 | 'dijit/_WidgetBase' 12 | ], function( 13 | declare, lang, 14 | router, hash, on, 15 | webMercatorUtils, 16 | _WidgetBase 17 | ) { 18 | return declare([_WidgetBase], { 19 | 20 | postCreate: function() { 21 | this.inherited(arguments); 22 | 23 | router.register('/:longitude/:latitude/:zoomLevel', lang.hitch(this, 'handleHashChange')); 24 | router.startup(); 25 | if (hash() === '') { 26 | router.go('/'); 27 | } 28 | this.own(on(this.map, 'extent-change', lang.hitch(this, 'updateLocationHash'))); 29 | }, 30 | 31 | handleHashChange: function(evt) { 32 | if (this.hashUpdating) { 33 | this.hashUpdating = false; 34 | return; 35 | } 36 | this.changeLocation(evt); 37 | }, 38 | changeLocation: function(evt) { 39 | if (!this.hashUpdating) { 40 | this.mapUpdating = true; 41 | var zoom = evt.params.zoomLevel || this.map.getLevel(); 42 | this.map.centerAndZoom([evt.params.longitude, evt.params.latitude], zoom).then(lang.hitch(this, function() { 43 | this.mapUpdating = false; 44 | })); 45 | } 46 | }, 47 | updateLocationHash: function(evt) { 48 | if (!this.mapUpdating) { 49 | this.hashUpdating = true; 50 | var x = (evt.extent.xmax + evt.extent.xmin) / 2, 51 | y = (evt.extent.ymax + evt.extent.ymin) / 2; 52 | var geographicLocation = webMercatorUtils.xyToLngLat(x, y); 53 | var currentHash = hash().split('/'); 54 | currentHash[1] = geographicLocation[0].toFixed(5); 55 | currentHash[2] = geographicLocation[1].toFixed(5); 56 | currentHash[3] = this.map.getLevel(); 57 | hash(currentHash.join('/')); 58 | } 59 | } 60 | }); 61 | }); 62 | -------------------------------------------------------------------------------- /MapNavigationHash/README.md: -------------------------------------------------------------------------------- 1 | Map Navigation Hash (History) 2 | ====================== 3 | 4 | #### Overview 5 | Uses dojo/router to enable zooming to next or previous extent using the browser forward and back buttons. The geographic map center and map zoom level is placed on the url. 6 | 7 | #### CMV Configuration 8 | Include the following code in js/config/viewer.js: 9 | ```javascript 10 | navhash: { 11 | include: true, 12 | id: 'navhash', 13 | type: 'invisible', 14 | path: 'viewer/dijit/MapNavigationHash/MapNavigationHash', 15 | title: 'Map Navigation Hash', 16 | options: { 17 | map: true 18 | } 19 | } 20 | ``` 21 | 22 | #### Usage Example 23 | appurl.com/index.htlm#/_longitude_/_latitude_/_zoomLevel_ 24 | 25 | The application will automatically update the url hash on pan and zoom. Users may also manually edit the route to go to a specific long, lat, and zoom level. A user can bookmark the url in the browser and, on load, the app will zoom and pan to the bookmarked location. 26 | 27 | [Click for demo](http://brianbunker.github.com/cmv-widgets) 28 | 29 | Screen from Sample page: 30 | 31 | ![Screenshot](./screenshot.png) 32 | -------------------------------------------------------------------------------- /MapNavigationHash/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/MapNavigationHash/screenshot.png -------------------------------------------------------------------------------- /Nearby/Nearby/css/Nearby.css: -------------------------------------------------------------------------------- 1 | .gis_NearbyDijit .off { 2 | display: none; 3 | } 4 | 5 | .gis_NearbyDijit .padTop { 6 | margin-top: 5px; 7 | } 8 | 9 | .gis_NearbyDijit .padLeft { 10 | margin-left: 15px; 11 | } 12 | 13 | .gis_NearbyDijit .dijitButton { 14 | margin-left: 0; 15 | } 16 | 17 | .gis_NearbyDijit .nearbyValueInput { 18 | width: 30px; 19 | } 20 | 21 | .gis_NearbyDijit .resultsContainer { 22 | font-weight: bold; 23 | margin: 10px; 24 | } 25 | 26 | .gis_NearbyDijit .loading { 27 | display: inline-block; 28 | height: 20px; 29 | width: 20px; 30 | } 31 | 32 | .resultsGrid { 33 | position: relative; 34 | } 35 | 36 | .nearbyNonModal { 37 | width: 600px; 38 | } 39 | 40 | .nearbyNonModal .dockButton { 41 | display: inline-block; 42 | height: 15px; 43 | width: 15px; 44 | background-image: url('../images/dock.png'); 45 | background-size: 100%; 46 | cursor: pointer; 47 | float: right; 48 | margin-top: 7px; 49 | margin-right: 7px; 50 | } 51 | 52 | .resultsGrid .undockButton { 53 | display: inline-block; 54 | height: 15px; 55 | width: 15px; 56 | background-image: url('../images/undock.png'); 57 | background-size: 100%; 58 | cursor: pointer; 59 | margin-top: 7px; 60 | position: absolute; 61 | top: 0; 62 | right: 0; 63 | z-index: 1000; 64 | } 65 | 66 | .resultsGrid .dgrid { 67 | height: 240px; 68 | width:100%; 69 | overflow: auto; 70 | } 71 | .nearbyNonModal .dgrid { 72 | height: 335px; 73 | width:100%; 74 | overflow: auto; 75 | } 76 | 77 | .resultsGrid .dgrid .dgrid-scroller, 78 | .nearbyNonModal .dgrid .dgrid-scroller { 79 | margin-top: 56px !important; 80 | } 81 | 82 | .resultsGrid .dgrid .dgrid-header th, 83 | .nearbyNonModal .dgrid .dgrid-header th { 84 | font-weight: bold; 85 | } 86 | 87 | .resultsGrid .dgrid .dgrid-cell, 88 | .nearbyNonModal .dgrid .dgrid-cell { 89 | font-size: 11px; 90 | padding: 8px; 91 | cursor: pointer; 92 | width: 88px; 93 | } 94 | 95 | .resultsGrid .dgrid .dgrid-column-Descrip, 96 | .resultsGrid .dgrid .dgrid-column-NewsLink, 97 | .nearbyNonModal .dgrid .dgrid-column-Descrip, 98 | .nearbyNonModal .dgrid .dgrid-column-NewsLink { 99 | width: 300px; 100 | } 101 | 102 | .resultsGrid .dgrid .dgrid-row, 103 | .nearbyNonModal .dgrid .dgrid-row { 104 | border: none; 105 | } 106 | 107 | .resultsGrid .dgrid .dgrid-cell, 108 | .nearbyNonModal .dgrid .dgrid-cell { 109 | border-color: #ddd; 110 | border-style: solid; 111 | border-width: 0 1px 1px 0; 112 | } 113 | 114 | .resultsGrid .dgrid .dgrid-row-odd .dgrid-cell, 115 | .nearbyNonModal .dgrid .dgrid-row-odd .dgrid-cell { 116 | background-color: #eee; 117 | } 118 | 119 | .resultsGrid .dgrid .dgrid-selected .dgrid-cell, 120 | .nearbyNonModal .dgrid .dgrid-selected .dgrid-cell { 121 | background-color: #049cdb; 122 | } 123 | 124 | .nearbyNonModal_underlay { 125 | display: none; 126 | } -------------------------------------------------------------------------------- /Nearby/Nearby/images/crosshairs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/Nearby/Nearby/images/crosshairs.png -------------------------------------------------------------------------------- /Nearby/Nearby/images/dock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/Nearby/Nearby/images/dock.png -------------------------------------------------------------------------------- /Nearby/Nearby/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/Nearby/Nearby/images/loading.gif -------------------------------------------------------------------------------- /Nearby/Nearby/images/undock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/Nearby/Nearby/images/undock.png -------------------------------------------------------------------------------- /Nearby/Nearby/templates/Nearby.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
Set nearby area:
4 |
5 | 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 17 | 18 | 19 |
20 |
Summarize features from:
21 |
22 | 23 |
24 |
25 | 26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |
-------------------------------------------------------------------------------- /Nearby/README.md: -------------------------------------------------------------------------------- 1 | Nearby widget 2 | ================= 3 | Nearby widget for the [Configurable Map Viewer (CMV)](https://github.com/cmv/cmv-app) app. 4 | 5 | Use by adding the following to viewer.js config file. 6 | ```javascript 7 | nearby: { 8 | include: true, 9 | id: 'nearby', 10 | type: 'titlePane', 11 | canFloat: true, 12 | path: 'gis/dijit/Nearby', 13 | title: 'Nearby', 14 | open: false, 15 | options: { 16 | map: true, 17 | mapClickMode: true, 18 | isMapSRProjected: true //if the map's coordinate system is projected, set it to true; default is false 19 | } 20 | } 21 | ``` 22 | 23 | [Click for demo](http://brianbunker.github.com/dojo-esri-nearby-widget) 24 | 25 | Screen from Sample page: 26 | 27 | ![Screenshot](./screenshot.png) 28 | -------------------------------------------------------------------------------- /Nearby/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/Nearby/screenshot.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cmv-widgets 2 | 3 | Widgets created for [cmv/cmv-app](https://github.com/cmv/cmv-app). 4 | 5 | [See them live!](http://brianbunker.github.io/cmv-widgets/) 6 | 7 | ## Widgets 8 | 9 | | Widget | Description | 10 | | :----: | ----------- | 11 | | [Drag and Drop](http://github.com/BrianBunker/cmv-widgets/tree/master//DnD) | Add data to the map viewer by dragging and dropping resources onto the map or widget. | 12 | | [Goto Coordinate](http://github.com/BrianBunker/cmv-widgets/tree/master//Goto) | Center the map at a specific location in geographic, UTM, or MGRS coordinates. | 13 | | [Map Navigation Hash](http://github.com/BrianBunker/cmv-widgets/tree/master//MapNavigationHash) | Display the map center point in the url and use the browser back/forward buttons as previous/next extent buttons. | 14 | | [Nearby](http://github.com/BrianBunker/cmv-widgets/tree/master//Nearby) | Discover features within a radius or drivetime of a map click location. | 15 | -------------------------------------------------------------------------------- /images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/close.png -------------------------------------------------------------------------------- /images/esri-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/esri-logo.png -------------------------------------------------------------------------------- /images/linen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/linen.jpg -------------------------------------------------------------------------------- /images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/loading.gif -------------------------------------------------------------------------------- /images/noisy_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/noisy_grid.png -------------------------------------------------------------------------------- /images/noisy_grid_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/noisy_grid_dark.png -------------------------------------------------------------------------------- /images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/open.png -------------------------------------------------------------------------------- /images/pointertop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/pointertop.png -------------------------------------------------------------------------------- /images/rocket-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/images/rocket-logo.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Configurable Map Viewer 10 | 11 | 12 | 13 | 14 |
15 | 18 |
19 | 20 | Configurable Map Viewer 21 | 22 |
23 | make it your own 24 |
25 |
26 | 30 | 34 |
35 | 53 | 54 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /js/config/basemaps.js: -------------------------------------------------------------------------------- 1 | define([ 2 | //'esri/dijit/Basemap', 3 | //'esri/dijit/BasemapLayer', 4 | //'esri/layers/osm' 5 | ], function ( /* Basemap, BasemapLayer, osm */ ) { 6 | return { 7 | map: true, // needs a refrence to the map 8 | mode: 'agol', //must be either 'agol' or 'custom' 9 | title: 'Basemaps', // tilte for widget 10 | mapStartBasemap: 'streets', // must match one of the basemap keys below 11 | //basemaps to show in menu. define in basemaps object below and reference by name here 12 | // TODO Is this array necessary when the same keys are explicitly included/excluded below? 13 | basemapsToShow: ['streets', 'satellite', 'hybrid', 'topo', 'lightGray', 'gray', 'national-geographic', 'osm', 'oceans'], 14 | 15 | // define all valid custom basemaps here. Object of Basemap objects. For custom basemaps, the key name and basemap id must match. 16 | basemaps: { // agol basemaps 17 | streets: { 18 | title: 'Streets' 19 | }, 20 | satellite: { 21 | title: 'Satellite' 22 | }, 23 | hybrid: { 24 | title: 'Hybrid' 25 | }, 26 | topo: { 27 | title: 'Topo' 28 | }, 29 | gray: { 30 | title: 'Gray' 31 | }, 32 | oceans: { 33 | title: 'Oceans' 34 | }, 35 | 'national-geographic': { 36 | title: 'Nat Geo' 37 | }, 38 | osm: { 39 | title: 'Open Street Map' 40 | } 41 | 42 | // examples of custom basemaps 43 | 44 | /*streets: { 45 | title: 'Streets', 46 | basemap: new Basemap({ 47 | id: 'streets', 48 | layers: [new BasemapLayer({ 49 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer' 50 | })] 51 | }) 52 | }, 53 | satellite: { 54 | title: 'Satellite', 55 | basemap: new Basemap({ 56 | id: 'satellite', 57 | layers: [new BasemapLayer({ 58 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' 59 | })] 60 | }) 61 | }, 62 | hybrid: { 63 | title: 'Hybrid', 64 | basemap: new Basemap({ 65 | id: 'hybrid', 66 | layers: [new BasemapLayer({ 67 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' 68 | }), new BasemapLayer({ 69 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer', 70 | isReference: true, 71 | displayLevels: [0, 1, 2, 3, 4, 5, 6, 7] 72 | }), new BasemapLayer({ 73 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer', 74 | isReference: true, 75 | displayLevels: [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] 76 | })] 77 | }) 78 | }, 79 | lightGray: { 80 | title: 'Light Gray Canvas', 81 | basemap: new Basemap({ 82 | id: 'lightGray', 83 | layers: [new BasemapLayer({ 84 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer' 85 | }), new BasemapLayer({ 86 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer', 87 | isReference: true 88 | })] 89 | }) 90 | }*/ 91 | } 92 | }; 93 | }); -------------------------------------------------------------------------------- /js/config/bookmarks.js: -------------------------------------------------------------------------------- 1 | define({ 2 | map: true, 3 | editable: true, 4 | bookmarks: [ 5 | { 6 | extent: { 7 | xmin: -15489130.48708616, 8 | ymin: 398794.4860580916, 9 | xmax: -5891085.7193757, 10 | ymax: 8509680.431452557, 11 | spatialReference: { 12 | wkid: 102100 13 | } 14 | }, 15 | name: 'USA' 16 | } 17 | ] 18 | }); -------------------------------------------------------------------------------- /js/config/find.js: -------------------------------------------------------------------------------- 1 | define({ 2 | map: true, 3 | queries: [ 4 | { 5 | description: 'Find A Public Safety Location By Name', 6 | url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', 7 | layerIds: [1, 2, 3, 4, 5, 6, 7], 8 | searchFields: ['FDNAME, PDNAME', 'NAME', 'RESNAME'], 9 | minChars: 2 10 | }, 11 | { 12 | description: 'Find Incident By Code/Description', 13 | url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', 14 | layerIds: [15, 17, 18], 15 | searchFields: ['FCODE', 'DESCRIPTION'], 16 | minChars: 4 17 | } 18 | ] 19 | }); -------------------------------------------------------------------------------- /js/config/identify.js: -------------------------------------------------------------------------------- 1 | define({ 2 | map: true, 3 | mapClickMode: true, 4 | mapRightClickMenu: true, 5 | identifyLayerInfos: true, 6 | identifyTolerance: 5, 7 | 8 | // config object definition: 9 | // {:{ 10 | // :{ 11 | // 12 | // } 13 | // }, 14 | // :{ 15 | // :{ 16 | // 17 | // } 18 | // } 19 | // } 20 | 21 | // for details on pop-up definition see: https://developers.arcgis.com/javascript/jshelp/intro_popuptemplate.html 22 | 23 | identifies: { 24 | meetupHometowns: { 25 | 0: { 26 | title: 'Hometowns', 27 | fieldInfos: [{ 28 | fieldName: 'Location', 29 | visible: true 30 | }] 31 | } 32 | }, 33 | louisvillePubSafety: { 34 | 2: { 35 | title: 'Police Station', 36 | fieldInfos: [{ 37 | fieldName: 'Name', 38 | visible: true 39 | }, { 40 | fieldName: 'Address', 41 | visible: true 42 | }, { 43 | fieldName: 'Type', 44 | visible: true 45 | }, { 46 | fieldName: 'Police Function', 47 | visible: true 48 | }, { 49 | fieldName: 'Last Update Date', 50 | visible: true 51 | }] 52 | }, 53 | 8: { 54 | title: 'Traffic Camera', 55 | description: '{Description} lasted updated: {Last Update Date}', 56 | mediaInfos: [{ 57 | title: '', 58 | caption: '', 59 | type: 'image', 60 | value: { 61 | sourceURL: '{Location URL}', 62 | linkURL: '{Location URL}' 63 | } 64 | }] 65 | } 66 | } 67 | } 68 | }); -------------------------------------------------------------------------------- /js/dbootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dbootstrap", 3 | "dojoBuild": "package.js" 4 | } 5 | -------------------------------------------------------------------------------- /js/dbootstrap/theme/dbootstrap/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/dbootstrap/theme/dbootstrap/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /js/dbootstrap/theme/dbootstrap/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/dbootstrap/theme/dbootstrap/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /js/dbootstrap/theme/dbootstrap/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/dbootstrap/theme/dbootstrap/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /js/gis/dijit/Basemaps.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/_WidgetBase', 4 | 'dijit/_TemplatedMixin', 5 | 'dijit/_WidgetsInTemplateMixin', 6 | 'dojo/_base/lang', 7 | 'dijit/DropDownMenu', 8 | 'dijit/MenuItem', 9 | 'dojo/_base/array', 10 | 'dojox/lang/functional', 11 | 'dojo/text!./Basemaps/templates/Basemaps.html', 12 | 'esri/dijit/BasemapGallery', 13 | 'xstyle/css!./Basemaps/css/Basemaps.css' 14 | ], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, DropDownMenu, MenuItem, array, functional, template, BasemapGallery) { 15 | 16 | // main basemap widget 17 | return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { 18 | templateString: template, 19 | widgetsInTemplate: true, 20 | mode: 'agol', 21 | title: 'Basemaps', 22 | //baseClass: 'gis_Basemaps_Dijit', 23 | //buttonClass: 'gis_Basemaps_Button', 24 | //menuClass: 'gis_Basemaps_Menu', 25 | mapStartBasemap: 'streets', 26 | basemapsToShow: ['streets', 'satellite', 'hybrid', 'topo', 'gray', 'oceans', 'national-geographic', 'osm'], 27 | validBasemaps: [], 28 | postCreate: function () { 29 | this.inherited(arguments); 30 | this.currentBasemap = this.mapStartBasemap || null; 31 | 32 | if (this.mode === 'custom') { 33 | this.gallery = new BasemapGallery({ 34 | map: this.map, 35 | showArcGISBasemaps: false, 36 | basemaps: functional.map(this.basemaps, function (map) { 37 | return map.basemap; 38 | }) 39 | }); 40 | // if (this.map.getBasemap() !== this.mapStartBasemap) { //based off the title of custom basemaps in viewer.js config 41 | // this.gallery.select(this.mapStartBasemap); 42 | // } 43 | this.gallery.startup(); 44 | } 45 | 46 | this.menu = new DropDownMenu({ 47 | style: 'display: none;' //, 48 | //baseClass: this.menuClass 49 | }); 50 | 51 | array.forEach(this.basemapsToShow, function (basemap) { 52 | if (this.basemaps.hasOwnProperty(basemap)) { 53 | var menuItem = new MenuItem({ 54 | id: basemap, 55 | label: this.basemaps[basemap].title, 56 | iconClass: (basemap == this.mapStartBasemap) ? 'selectedIcon' : 'emptyIcon', 57 | onClick: lang.hitch(this, function () { 58 | if (basemap !== this.currentBasemap) { 59 | this.currentBasemap = basemap; 60 | if (this.mode === 'custom') { 61 | this.gallery.select(basemap); 62 | } else { 63 | this.map.setBasemap(basemap); 64 | } 65 | var ch = this.menu.getChildren(); 66 | array.forEach(ch, function (c) { 67 | if (c.id == basemap) { 68 | c.set('iconClass', 'selectedIcon'); 69 | } else { 70 | c.set('iconClass', 'emptyIcon'); 71 | } 72 | }); 73 | } 74 | }) 75 | }); 76 | this.menu.addChild(menuItem); 77 | } 78 | }, this); 79 | 80 | this.dropDownButton.set('dropDown', this.menu); 81 | }, 82 | startup: function () { 83 | this.inherited(arguments); 84 | if (this.mode === 'custom') { 85 | if (this.map.getBasemap() !== this.mapStartBasemap) { //based off the title of custom basemaps in viewer.js config 86 | this.gallery.select(this.mapStartBasemap); 87 | } 88 | } else { 89 | if (this.mapStartBasemap) { 90 | if (this.map.getBasemap() !== this.mapStartBasemap) { //based off the agol basemap name 91 | this.map.setBasemap(this.mapStartBasemap); 92 | } 93 | } 94 | } 95 | } 96 | }); 97 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Basemaps/css/Basemaps.css: -------------------------------------------------------------------------------- 1 | /*.gis_Basemaps_Dijit .gis_Basemaps_Button { 2 | background-color: #FFFFFF; 3 | border: 2px solid #666666; 4 | border-radius: 5px 5px 5px 5px; 5 | cursor: pointer; 6 | padding: 7px; 7 | } 8 | 9 | .gis_Basemaps_MenuPopup { 10 | margin-top: -4px; 11 | background-color: #FFFFFF; 12 | border: 2px solid #666666; 13 | border-radius: 0 0 5px 5px; 14 | padding: 2px; 15 | } 16 | 17 | .gis_Basemaps_MenuPopup.dijitPopup { 18 | box-shadow: none; 19 | } 20 | 21 | .gis_Basemaps_MenuPopup table { 22 | border: none !important; 23 | } 24 | 25 | .gis_Basemaps_MenuPopup .selectedIcon { 26 | background-image: url(../images/check.png); 27 | width: 16px; 28 | height: 16px; 29 | } 30 | 31 | .gis_Basemaps_MenuPopup .clearIcon { 32 | background-image: url(../images/clear.png); 33 | width: 16px; 34 | height: 16px; 35 | } 36 | 37 | .gis_Basemaps_Dijit .gis_Basemaps_Button .dijitButtonNode { 38 | border: none; 39 | }*/ 40 | 41 | .selectedIcon:before { 42 | content: "\f046"; 43 | } 44 | 45 | .emptyIcon:before { 46 | content: "\f096"; 47 | } 48 | 49 | .basemapsIcon:before { 50 | content: "\f009"; 51 | } -------------------------------------------------------------------------------- /js/gis/dijit/Basemaps/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Basemaps/images/check.png -------------------------------------------------------------------------------- /js/gis/dijit/Basemaps/images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Basemaps/images/clear.png -------------------------------------------------------------------------------- /js/gis/dijit/Basemaps/templates/Basemaps.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | ${title} 5 | 6 |
7 |
8 | -------------------------------------------------------------------------------- /js/gis/dijit/Bookmarks.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/_WidgetBase', 4 | 'esri/dijit/Bookmarks', 5 | 'dojo/json', 6 | 'dojo/cookie', 7 | 'dojo/_base/lang', 8 | 'xstyle/css!./Bookmarks/css/Bookmarks.css' 9 | ], function (declare, _WidgetBase, Bookmarks, json, cookie, lang) { 10 | 11 | return declare([_WidgetBase], { 12 | declaredClass: 'gis.digit.Bookmarks', 13 | postCreate: function () { 14 | this.inherited(arguments); 15 | var bookmarks = this.bookmarks; // from the options passed in 16 | this.bookmarkItems = cookie('bookmarkItems'); 17 | if (this.bookmarkItems === undefined) { 18 | this.bookmarkItems = []; 19 | } else { 20 | this.bookmarkItems = json.parse(this.bookmarkItems); 21 | } 22 | 23 | this.bookmarks = new Bookmarks({ 24 | map: this.map, 25 | editable: this.editable, 26 | bookmarks: lang.mixin(this.bookmarkItems, bookmarks) 27 | }, this.domNode); 28 | 29 | this.connect(this.bookmarks, 'onEdit', 'setBookmarks'); 30 | this.connect(this.bookmarks, 'onRemove', 'setBookmarks'); 31 | }, 32 | setBookmarks: function () { 33 | cookie('bookmarkItems', json.stringify(this.bookmarks.toJson()), { 34 | expires: 365 35 | }); 36 | }, 37 | _export: function () { 38 | return json.stringify(this.bookmarks.toJson()); 39 | } 40 | }); 41 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Bookmarks/css/Bookmarks.css: -------------------------------------------------------------------------------- 1 | .esriBookmarks { 2 | width: 100%; 3 | border: none; 4 | } 5 | 6 | .esriBookmarkTable { 7 | width: 100%; 8 | } 9 | 10 | .esriBookmarkItem { 11 | width: 100%; 12 | } -------------------------------------------------------------------------------- /js/gis/dijit/Directions.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/_WidgetBase', 4 | 'dijit/_TemplatedMixin', 5 | 'esri/dijit/Directions', 6 | 'dojo/text!./Directions/templates/Directions.html', 7 | 'dojo/_base/lang', 8 | 'dijit/Menu', 9 | 'dijit/MenuItem', 10 | 'dijit/PopupMenuItem', 11 | 'dijit/MenuSeparator', 12 | 'esri/geometry/Point', 13 | 'esri/SpatialReference', 14 | 'dojo/topic' 15 | ], function (declare, _WidgetBase, _TemplatedMixin, Directions, template, lang, Menu, MenuItem, PopupMenuItem, MenuSeparator, Point, SpatialReference, topic) { 16 | 17 | return declare([_WidgetBase, _TemplatedMixin], { 18 | templateString: template, 19 | postCreate: function () { 20 | this.inherited(arguments); 21 | this.directions = new Directions(lang.mixin({ 22 | map: this.map 23 | }, this.options), this.directionsNode); 24 | this.directions.startup(); 25 | 26 | if (this.mapRightClickMenu) { 27 | this.addRightClickMenu(); 28 | } 29 | }, 30 | addRightClickMenu: function () { 31 | // capture map right click position 32 | this.map.on('MouseDown', lang.hitch(this, function (evt) { 33 | this.mapRightClickPoint = evt.mapPoint; 34 | })); 35 | 36 | this.menu = new Menu(); 37 | this.menu.addChild(new MenuItem({ 38 | label: 'Directions from here', 39 | onClick: lang.hitch(this, 'directionsFrom') 40 | })); 41 | this.menu.addChild(new MenuItem({ 42 | label: 'Directions to here', 43 | onClick: lang.hitch(this, 'directionsTo') 44 | })); 45 | this.menu.addChild(new MenuSeparator()); 46 | this.menu.addChild(new MenuItem({ 47 | label: 'Add stop', 48 | onClick: lang.hitch(this, 'addStop') 49 | })); 50 | this.menu.addChild(new MenuSeparator()); 51 | this.menu.addChild(new MenuItem({ 52 | label: 'Use my location as start point', 53 | onClick: lang.hitch(this, 'getGeoLocation', 'directionsFrom') 54 | })); 55 | this.menu.addChild(new MenuItem({ 56 | label: 'Use my location as end point', 57 | onClick: lang.hitch(this, 'getGeoLocation', 'directionsTo') 58 | })); 59 | 60 | // add this widgets menu as a sub menu to the map right click menu 61 | this.mapRightClickMenu.addChild(new PopupMenuItem({ 62 | label: 'Directions', 63 | popup: this.menu 64 | })); 65 | }, 66 | clearStops: function () { 67 | this.directions.reset(); 68 | }, 69 | directionsFrom: function () { 70 | this.directions.updateStop(this.mapRightClickPoint, 0).then(lang.hitch(this, 'doRoute')); 71 | }, 72 | directionsTo: function () { 73 | this.directions.updateStop(this.mapRightClickPoint, this.directions.stops.length - 1).then(lang.hitch(this, 'doRoute')); 74 | }, 75 | addStop: function () { 76 | this.directions.addStop(this.mapRightClickPoint, this.directions.stops.length - 1).then(lang.hitch(this, 'doRoute')); 77 | }, 78 | doRoute: function () { 79 | if (this.parentWidget && !this.parentWidget.open) { 80 | this.parentWidget.toggle(); 81 | } 82 | if (this.directions.stops[0] && this.directions.stops[1]) { 83 | this.directions.getDirections(); 84 | } 85 | }, 86 | startAtMyLocation: function () { 87 | this.getGeoLocation('directionsFrom'); 88 | }, 89 | endAtMyLocation: function () { 90 | this.getGeoLocation('directionsTo'); 91 | }, 92 | getGeoLocation: function (leg) { 93 | if (navigator && navigator.geolocation) { 94 | navigator.geolocation.getCurrentPosition(lang.hitch(this, 'locationSuccess', leg), lang.hitch(this, 'locationError')); 95 | } else { 96 | topic.publish('growler/growl', { 97 | title: 'Error', 98 | message: 'Geolocation not supported by your browser.', 99 | level: 'default', 100 | timeout: 10000, 101 | opacity: 1.0 102 | }); 103 | } 104 | }, 105 | locationSuccess: function (leg, event) { 106 | this.mapRightClickPoint = new Point(event.coords.longitude, event.coords.latitude, new SpatialReference({ 107 | wkid: 4326 108 | })); 109 | this[leg](); 110 | }, 111 | locationError: function (error) { 112 | topic.publish('growler/growl', { 113 | title: 'Error', 114 | message: 'There was a problem with getting your location: ' + error.message, 115 | level: 'default', 116 | timeout: 10000, 117 | opacity: 1.0 118 | }); 119 | } 120 | }); 121 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Directions/templates/Directions.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/gis/dijit/Draw/css/Draw.css: -------------------------------------------------------------------------------- 1 | .gis_DrawDijit { 2 | } 3 | 4 | .gis_DrawDijit .polyIcon { 5 | background-image: url(../images/toolbar_icons.png); 6 | background-position: -68px 0; 7 | width: 16px; 8 | height: 16px; 9 | } 10 | 11 | .gis_DrawDijit .pointIcon { 12 | background-image: url(../images/toolbar_icons.png); 13 | background-position: 0px 0; 14 | width: 16px; 15 | height: 16px; 16 | } 17 | 18 | .gis_DrawDijit .circleDrawIcon { 19 | background-image: url(../images/toolbar_icons.png); 20 | background-position: -390px 0; 21 | width: 16px; 22 | height: 16px; 23 | } 24 | 25 | .gis_DrawDijit .lineIcon { 26 | background-image: url(../images/toolbar_icons.png); 27 | background-position: -34px 0; 28 | width: 16px; 29 | height: 16px; 30 | } 31 | 32 | .gis_DrawDijit .freehandDrawIcon { 33 | background-image: url(../images/toolbar_icons.png); 34 | background-position: -102px 0; 35 | width: 16px; 36 | height: 16px; 37 | } 38 | 39 | .gis_DrawDijit .clearIcon { 40 | background-image: url(../images/clear.png); 41 | width: 16px; 42 | height: 16px; 43 | } 44 | 45 | .gis_DrawDijit .formContainer { 46 | /*border: 1px solid #bbb;*/ 47 | margin-bottom: -1px; 48 | width: 100%; 49 | } 50 | 51 | .gis_DrawDijit .buttonActionBar { 52 | /*background-color: #F2F2F2; 53 | border: 1px solid #CDCDCD;*/ 54 | padding: 3px 0px 2px 0px; 55 | text-align: right; 56 | width: 100%; 57 | } -------------------------------------------------------------------------------- /js/gis/dijit/Draw/images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Draw/images/clear.png -------------------------------------------------------------------------------- /js/gis/dijit/Draw/images/toolbar_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Draw/images/toolbar_icons.png -------------------------------------------------------------------------------- /js/gis/dijit/Draw/templates/Draw.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 16 | 17 | 18 | 28 | 29 | 30 | 40 | 41 |
7 | 11 | 15 |
19 | 23 | 27 |
31 | 35 | 39 |
42 |
43 |
44 |
45 | 49 |
50 |
51 | -------------------------------------------------------------------------------- /js/gis/dijit/Editor.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/_WidgetBase', 4 | 'dijit/_TemplatedMixin', 5 | 'dijit/_WidgetsInTemplateMixin', 6 | 'dojo/_base/lang', 7 | 'dojo/dom-construct', 8 | 'dojo/topic', 9 | 'dojo/aspect' 10 | ], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, domConstruct, topic, aspect) { 11 | 12 | return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { 13 | templateString: '
', 14 | widgetsInTemplate: true, 15 | editor: null, 16 | isEdit: false, 17 | mapClickMode: null, 18 | postCreate: function () { 19 | this.inherited(arguments); 20 | this.own(topic.subscribe('mapClickMode/currentSet', lang.hitch(this, 'setMapClickMode'))); 21 | if (this.parentWidget && this.parentWidget.toggleable) { 22 | this.own(aspect.after(this.parentWidget, 'toggle', lang.hitch(this, function () { 23 | this.onLayoutChange(this.parentWidget.open); 24 | }))); 25 | } 26 | }, 27 | toggleEditing: function () { 28 | if (!this.isEdit) { 29 | var ops = lang.clone(this.settings); 30 | ops.map = this.map; 31 | ops.layerInfos = this.layerInfos; 32 | 33 | var con = domConstruct.create('div', { 34 | innerHTML: '', 35 | 'style': 'text-align:center;' 36 | }, this.containerNode, 'only'); 37 | 38 | require(['esri/dijit/editing/Editor'], lang.hitch(this, function (Editor) { 39 | this.editor = new Editor({ 40 | settings: ops 41 | }, con); 42 | this.editor.startup(); 43 | })); 44 | 45 | this.toggleBTN.set('label', 'Stop Editing'); 46 | this.toggleBTN.set('class', 'danger'); 47 | this.isEdit = true; 48 | topic.publish('mapClickMode/setCurrent', 'editor'); 49 | } else { 50 | this.endEditing(); 51 | topic.publish('mapClickMode/setDefault'); 52 | } 53 | }, 54 | endEditing: function () { 55 | if (this.editor && this.editor.destroyRecursive) { 56 | this.editor.destroyRecursive(); 57 | } 58 | this.toggleBTN.set('label', 'Start Editing'); 59 | this.toggleBTN.set('class', 'success'); 60 | this.isEdit = false; 61 | this.editor = null; 62 | }, 63 | 64 | onLayoutChange: function (open) { 65 | // end edit on close of title pane 66 | if (!open && this.mapClickMode === 'editor') { 67 | this.endEditing(); 68 | topic.publish('mapClickMode/setDefault'); 69 | } 70 | }, 71 | setMapClickMode: function (mode) { 72 | this.mapClickMode = mode; 73 | if (mode !== 'editor') { 74 | this.endEditing(); 75 | } 76 | } 77 | }); 78 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Find/css/Find.css: -------------------------------------------------------------------------------- 1 | .gis_FindDijit { 2 | width: 100%; 3 | } 4 | .gis_FindDijit .querySelect, .gis_FindDijit .searchText { 5 | width:100%; 6 | margin-bottom: 10px; 7 | } 8 | 9 | .gis_FindDijit .containsCheck { 10 | margin-bottom: 10px; 11 | margin-left: 10px; 12 | } 13 | 14 | .gis_FindDijit .clearButton { 15 | float: right; 16 | } 17 | 18 | .gis_FindDijit .searchIcon { 19 | background-image: url(../images/search.png); 20 | width: 16px; 21 | height: 16px; 22 | } 23 | 24 | .gis_FindDijit .clearIcon { 25 | background-image: url(../images/clear.png); 26 | width: 16px; 27 | height: 16px; 28 | } 29 | 30 | .gis_FindDijit label { 31 | font-weight:bold; 32 | margin-left: 5px; 33 | } 34 | 35 | .gis_FindDijit .resultsContainer { 36 | font-weight: bold; 37 | margin: 10px; 38 | display: none; 39 | } 40 | 41 | .gis_FindDijit .dgrid { 42 | height: 240px !important; 43 | width:100%; 44 | display: none; 45 | } 46 | 47 | .gis_FindDijit .dgrid .dgrid-scroller { 48 | margin-top: 35px !important; 49 | } 50 | 51 | .gis_FindDijit .dgrid .dgrid-header th { 52 | font-weight: bold; 53 | } 54 | 55 | .gis_FindDijit .dgrid .dgrid-cell { 56 | font-size: 11px; 57 | padding: 8px !important; 58 | cursor: pointer; 59 | } 60 | 61 | .gis_FindDijit .dgrid .field-value { 62 | width: 70%; 63 | } 64 | 65 | .gis_FindDijit .dgrid .field-foundFieldName { 66 | display: none; 67 | } -------------------------------------------------------------------------------- /js/gis/dijit/Find/images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Find/images/clear.png -------------------------------------------------------------------------------- /js/gis/dijit/Find/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Find/images/search.png -------------------------------------------------------------------------------- /js/gis/dijit/Find/templates/Find.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 8 |
9 |
10 |
11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 | Search 19 |
20 |
21 | Clear 22 |
23 |
24 |
25 |
26 |
27 |
-------------------------------------------------------------------------------- /js/gis/dijit/FloatingTitlePane.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/TitlePane', 4 | 'dojo/on', 5 | 'dojo/_base/lang', 6 | 'dojo/dnd/Moveable', 7 | 'dojo/aspect', 8 | 'dojo/topic', 9 | 'dojo/_base/window', 10 | 'dojo/window', 11 | 'dojo/dom-geometry', 12 | 'dojo/dom-style', 13 | 'dojo/dom-construct', 14 | 'dojo/dom-attr', 15 | 'dojo/dom-class', 16 | 'xstyle/css!./FloatingTitlePane/css/FloatingTitlePane.css' 17 | ], function (declare, TitlePane, on, lang, Moveable, aspect, topic, win, winUtils, domGeom, domStyle, domConstruct, domAttr, domClass) { 18 | return declare([TitlePane], { 19 | postCreate: function () { 20 | if (this.canFloat) { 21 | this.createDomNodes(); 22 | this.own(on(window, 'resize', lang.hitch(this, '_endDrag'))); 23 | } 24 | this.own(aspect.after(this, 'toggle', lang.hitch(this, '_afterToggle'))); 25 | this.inherited(arguments); 26 | }, 27 | startup: function () { 28 | if (this.titleBarNode && this.canFloat) { 29 | this._moveable = new Moveable(this.domNode, { 30 | handle: this.moveHandleNode 31 | }); 32 | aspect.after(this._moveable, 'onMoveStop', lang.hitch(this, '_endDrag'), true); 33 | aspect.after(this._moveable, 'onFirstMove', lang.hitch(this, '_moveDom'), true); 34 | } 35 | this.inherited(arguments); 36 | }, 37 | createDomNodes: function () { 38 | this.dockHandleNode = domConstruct.create('span', { 39 | title: 'Dock widget' 40 | }, this.titleNode, 'after'); 41 | domStyle.set(this.dockHandleNode, 'display', 'none'); 42 | domClass.add(this.dockHandleNode, 'floatingWidgetDock'); 43 | this.own(on(this.dockHandleNode, 'click', lang.hitch(this, function (evt) { 44 | this._dockWidget(); 45 | evt.stopImmediatePropagation(); 46 | }))); 47 | 48 | this.moveHandleNode = domConstruct.create('span', { 49 | title: 'Move widget' 50 | }, this.titleNode, 'after'); 51 | domClass.add(this.moveHandleNode, 'floatingWidgetPopout'); 52 | this.own(on(this.moveHandleNode, 'click', lang.hitch(this, function (evt) { 53 | this._undockWidget(); 54 | evt.stopImmediatePropagation(); 55 | }))); 56 | }, 57 | _undockWidget: function () { 58 | if (!this.isFloating) { 59 | domClass.add(this.moveHandleNode, 'floatingWidgetMove'); 60 | domClass.remove(this.moveHandleNode, 'floatingWidgetPopout'); 61 | } 62 | }, 63 | _dockWidget: function () { 64 | domAttr.remove(this.domNode, 'style'); 65 | domStyle.set(this.dockHandleNode, 'display', 'none'); 66 | var dockedWidgets = this.sidebar.getChildren(); 67 | this.placeAt(this.sidebar, dockedWidgets.length); 68 | domClass.remove(this.moveHandleNode, 'floatingWidgetMove'); 69 | domClass.add(this.moveHandleNode, 'floatingWidgetPopout'); 70 | this.isFloating = false; 71 | this._updateTopic('dock'); 72 | }, 73 | _moveDom: function () { 74 | if (!this.isFloating) { 75 | domStyle.set(this.dockHandleNode, 'display', 'inline'); 76 | domStyle.set(this.domNode, 'z-index', '40'); 77 | domClass.add(this.moveHandleNode, 'floatingWidgetMove'); 78 | domClass.remove(this.moveHandleNode, 'floatingWidgetPopout'); 79 | var computedStyle = domStyle.getComputedStyle(this.containerNode); 80 | var width = parseInt(domStyle.getComputedStyle(this.sidebar.containerNode).width, 10); 81 | domGeom.setContentSize(this.domNode, { 82 | w: (width - 2) 83 | }, computedStyle); 84 | // domGeom.setContentSize(this.titleBarNode, { 85 | // w: (width - 32) 86 | // }, computedStyle); 87 | this.isFloating = true; 88 | this.placeAt(win.body()); 89 | this._updateTopic('undock'); 90 | } 91 | }, 92 | _endDrag: function () { 93 | // summary: 94 | // Called after dragging the Dialog. Saves the position of the dialog in the viewport, 95 | // and also adjust position to be fully within the viewport, so user doesn't lose access to handle 96 | var nodePosition = domGeom.position(this.domNode); 97 | var viewport = winUtils.getBox(this.ownerDocument); 98 | nodePosition.y = Math.min(Math.max(nodePosition.y, 0), (viewport.h - nodePosition.h)); 99 | nodePosition.x = Math.min(Math.max(nodePosition.x, 0), (viewport.w - nodePosition.w)); 100 | this._relativePosition = nodePosition; 101 | this._position(); 102 | }, 103 | _position: function () { 104 | // summary: 105 | // Position the dialog in the viewport. If no relative offset 106 | // in the viewport has been determined (by dragging, for instance), 107 | // center the dialog. Otherwise, use the Dialog's stored relative offset, 108 | // adjusted by the viewport's scroll. 109 | if (!domClass.contains(this.ownerDocumentBody, 'dojoMove')) { // don't do anything if called during auto-scroll 110 | var node = this.domNode, 111 | viewport = winUtils.getBox(this.ownerDocument), 112 | p = this._relativePosition, 113 | bb = p ? null : domGeom.position(node), 114 | l = Math.floor(viewport.l + (p ? p.x : (viewport.w - bb.w) / 2)), 115 | t = Math.floor(viewport.t + (p ? p.y : (viewport.h - bb.h) / 2)); 116 | domStyle.set(node, { 117 | left: l + 'px', 118 | top: t + 'px' 119 | }); 120 | } 121 | }, 122 | _updateTopic: function (msg) { 123 | topic.publish('titlePane/event', { 124 | category: 'Titlepane Event', 125 | action: msg, 126 | label: this.title, 127 | value: msg 128 | }); 129 | 130 | }, 131 | _afterToggle: function () { 132 | var evt = this.open ? 'open' : 'close'; 133 | this._updateTopic(evt); 134 | } 135 | }); 136 | }); -------------------------------------------------------------------------------- /js/gis/dijit/FloatingTitlePane/css/FloatingTitlePane.css: -------------------------------------------------------------------------------- 1 | .floatingWidgetMove:before { 2 | float: right; 3 | margin-left: 10px; 4 | content: "\f047"; 5 | font-family: FontAwesome; 6 | } 7 | .floatingWidgetDock:before { 8 | float: right; 9 | content: "\f112"; 10 | font-family: FontAwesome; 11 | } 12 | .floatingWidgetPopout:before { 13 | float: right; 14 | content: "\f064"; 15 | font-family: FontAwesome; 16 | } -------------------------------------------------------------------------------- /js/gis/dijit/FloatingWidgetDialog.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/Dialog' 4 | ], function (declare, Dialog) { 5 | return declare([Dialog], { 6 | declaredClass: 'gis.dijit.FloatingWidget', 7 | title: 'Floating Widget', 8 | draggable: true, 9 | 'class': 'floatingWidget', 10 | close: function () { 11 | this.hide(); 12 | }, 13 | focus: function () {} 14 | }); 15 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Geocoder.js: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/esri/arcgis-dijit-geocoder-button-js/ 2 | define([ 3 | 'dojo/_base/declare', 4 | 'dijit/_WidgetBase', 5 | 'dijit/_TemplatedMixin', 6 | 'dijit/a11yclick', 7 | 'dojo/_base/lang', 8 | 'dojo/on', 9 | 'dojo/dom-class', 10 | 'dojo/dom-style', 11 | 'esri/dijit/Geocoder', 12 | 'dijit/MenuItem', 13 | 'esri/symbols/SimpleMarkerSymbol', 14 | 'esri/graphic', 15 | 'esri/InfoTemplate', 16 | 'esri/layers/GraphicsLayer', 17 | 'dojo/text!./Geocoder/templates/Geocoder.html', 18 | 'xstyle/css!./Geocoder/css/Geocoder.css' 19 | ], function (declare, _WidgetBase, _TemplatedMixin, a11yclick, lang, on, domClass, domStyle, Geocoder, MenuItem, SimpleMarkerSymbol, Graphic, InfoTemplate, GraphicsLayer, template) { 20 | return declare([_WidgetBase, _TemplatedMixin], { 21 | templateString: template, 22 | baseClass: 'gis_GeocoderDijit', 23 | expanded: true, 24 | collapsible: false, 25 | geocoderOptions: { 26 | autoComplete: true 27 | }, 28 | reverseGeocodeTemplate: [ 29 | '', 30 | '', '', '', '', 31 | '', '', '', '', 32 | '', '', '', '', 33 | '', '', '', '', 34 | '', '', '', '', 35 | '', '', '', '', 36 | '', '', '', '', 37 | '', '', '', '', 38 | '
Address${Address}
Neighborhood${Neighborhood}
City${City}
Subregion${SubRegion}
Region${Region}
Postal Code${Postal} ${PostalExt}
Country Code${CountryCode}
Locator Name${Loc_name}
' 39 | ].join(''), 40 | 41 | postCreate: function () { 42 | this.inherited(arguments); 43 | var options = lang.mixin({}, this.geocoderOptions, { 44 | map: this.map 45 | }); 46 | this.geocoder = new Geocoder(options, this.geocoderNode); 47 | 48 | on(this.geocoder, 'select', lang.hitch(this, function (e) { 49 | if (e.result) { 50 | this.show(); 51 | } 52 | })); 53 | 54 | if (this.collapsible) { 55 | on(this.map, 'pan-start', lang.hitch(this, function () { 56 | this.hide(); 57 | })); 58 | this.own( 59 | on(this.searchNode, a11yclick, lang.hitch(this, this.toggle)) 60 | ); 61 | } else { 62 | this.expanded = true; 63 | } 64 | this.geocoder.startup(); 65 | if (this.expanded === true) { 66 | this.show(); 67 | } else { 68 | this.hide(); 69 | } 70 | if (this.mapRightClickMenu) { 71 | this.addRightClickMenu(); 72 | } 73 | }, 74 | addRightClickMenu: function () { 75 | this.map.on('MouseDown', lang.hitch(this, function (evt) { 76 | this.mapRightClickPoint = evt.mapPoint; 77 | })); 78 | this.mapRightClickMenu.addChild(new MenuItem({ 79 | label: 'Get address here', 80 | onClick: lang.hitch(this, 'reverseGeocode') 81 | })); 82 | this.symbol = new SimpleMarkerSymbol(); 83 | this.infoTemplate = new InfoTemplate('Location', this.reverseGeocodeTemplate); 84 | this.graphics = new GraphicsLayer({ 85 | id: 'reverseGeocode' 86 | }); 87 | this.map.addLayer(this.graphics); 88 | }, 89 | toggle: function () { 90 | var display = domStyle.get(this.searchContainerNode, 'display'); 91 | if (display === 'block') { 92 | this.hide(); 93 | } else { 94 | this.show(); 95 | } 96 | }, 97 | hide: function () { 98 | domStyle.set(this.searchContainerNode, 'display', 'none'); 99 | domClass.remove(this.containerNode, 'open'); 100 | if (this.geocoder) { 101 | this.geocoder.blur(); 102 | } 103 | }, 104 | show: function () { 105 | domStyle.set(this.searchContainerNode, 'display', 'block'); 106 | domClass.add(this.containerNode, 'open'); 107 | if (this.geocoder && !this.expanded) { 108 | this.geocoder.focus(); 109 | } 110 | }, 111 | reverseGeocode: function () { 112 | this.geocoder._task.locationToAddress(this.mapRightClickPoint, 1000, lang.hitch(this, 'reverseGeocodeComplete')); 113 | }, 114 | reverseGeocodeComplete: function (res) { 115 | var graphic = new Graphic(res.location, this.symbol, res.address, this.infoTemplate); 116 | this.graphics.add(graphic); 117 | 118 | this.map.infoWindow.clearFeatures(); 119 | this.map.infoWindow.setTitle(graphic.getTitle()); 120 | this.map.infoWindow.setContent(graphic.getContent()); 121 | 122 | var screenPnt = this.map.toScreen(res.location); 123 | this.map.infoWindow.show(screenPnt, this.map.getInfoWindowAnchor(screenPnt)); 124 | on.once(this.map.infoWindow, 'hide', lang.hitch(this, function () { 125 | this.graphics.clear(); 126 | })); 127 | } 128 | }); 129 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Geocoder/css/Geocoder.css: -------------------------------------------------------------------------------- 1 | .gis_GeocoderDijit .zoomSearchButton { 2 | width: 30px; 3 | height: 26px; 4 | padding-top: 4px; 5 | text-align: center; 6 | cursor: pointer; 7 | border: 1px solid #57585A; 8 | background-color: #FFFFFF; 9 | -webkit-user-select: none; 10 | -moz-user-select: none; 11 | -ms-user-select: none; 12 | user-select: none; 13 | cursor: pointer; 14 | -webkit-border-radius: 5px; 15 | -moz-border-radius: 5px; 16 | -o-border-radius: 5px; 17 | border-radius: 5px; 18 | } 19 | .gis_GeocoderDijit .zoomSearchButton:after { 20 | content: '\f002'; 21 | font-family: FontAwesome; 22 | font-size: 16px; 23 | color: #444444; 24 | } 25 | .gis_GeocoderDijit .zoomSearchButton:hover { 26 | background-color: #EEEEEE; 27 | } 28 | .gis_GeocoderDijit .open .zoomSearchButton { 29 | -webkit-border-radius: 5px 0 0 5px; 30 | -moz-border-radius: 5px 0 0 5px; 31 | -o-border-radius: 5px 0 0 5px; 32 | border-radius: 5px 0 0 5px; 33 | border-right: 0; 34 | background-color: #FFFFFF; 35 | } 36 | .gis_GeocoderDijit .open .zoomSearchButton:hover { 37 | background-color: #FFFFFF; 38 | } 39 | .gis_GeocoderDijit .searchContainer { 40 | position: absolute; 41 | top: 0; 42 | left: 100%; 43 | width: 196px; 44 | } 45 | .gis_GeocoderDijit .esriGeocoderContainer * { 46 | -moz-box-sizing: content-box; 47 | -webkit-box-sizing: content-box; 48 | box-sizing: content-box; 49 | } 50 | .gis_GeocoderDijit .esriGeocoderContainer { 51 | width: 100%; 52 | font-size: 12px; 53 | font-family: verdana, helvetica; 54 | } 55 | .gis_GeocoderDijit .esriGeocoderContainer ul { 56 | margin: 0; 57 | padding: 0; 58 | list-style: none; 59 | display: block; 60 | } 61 | .gis_GeocoderDijit .esriGeocoderIcon { 62 | float: left; 63 | outline: 0; 64 | width: 16px; 65 | display: block; 66 | overflow: hidden; 67 | margin: 6px 0 6px 6px; 68 | } 69 | .gis_GeocoderDijit .dj_rtl .esriGeocoderIcon { 70 | float: right; 71 | margin: 6px 6px 6px 0; 72 | } 73 | .gis_GeocoderDijit .esriGeocoder .esriGeocoderClearFloat { 74 | clear: both; 75 | display: block; 76 | overflow: hidden; 77 | visibility: hidden; 78 | width: 0; 79 | height: 0; 80 | } 81 | .gis_GeocoderDijit .esriGeocoder { 82 | display: block; 83 | width: 100%; 84 | margin: 0px; 85 | margin-left: -1px; 86 | background: #fff; 87 | border: 1px solid #57585A; 88 | border-left: 0px; 89 | -webkit-border-radius: 0 5px 5px 0; 90 | border-radius: 0 5px 5px 0; 91 | } 92 | .gis_GeocoderDijit .esriGeocoderActive, .gis_GeocoderDijit .esriGeocoderMenuActive { 93 | border-bottom: 0; 94 | -webkit-border-radius: 0 5px 0 0; 95 | border-radius: 0 5px 0 0; 96 | } 97 | .gis_GeocoderDijit .esriGeocoder input { 98 | outline: 0; 99 | display: block; 100 | border: 0; 101 | border-collapse: collapse; 102 | vertical-align: middle; 103 | font-size: 12px; 104 | height: 16px; 105 | margin: 0; 106 | padding: 7px 0; 107 | float: left; 108 | color: #444; 109 | background: none; 110 | margin: 0 6px 0 0; 111 | /*width: 140px;*/ 112 | } 113 | .gis_GeocoderDijit .esriGeocoderMultiple input { 114 | width: 146px; 115 | } 116 | .gis_GeocoderDijit .dj_rtl .esriGeocoder input { 117 | float: right; 118 | } 119 | .gis_GeocoderDijit .esriGeocoder input:focus { 120 | color: #333; 121 | } 122 | .gis_GeocoderDijit .esriGeocoder .esriGeocoderSearch { 123 | display: none; 124 | } 125 | .gis_GeocoderDijit .dj_rtl .esriGeocoder .esriGeocoderSearch { 126 | margin-left: 0; 127 | margin-right: 6px; 128 | } 129 | .gis_GeocoderDijit .esriGeocoder .esriGeocoderSearch:hover, .gis_GeocoderDijit .esriGeocoder .esriGeocoderSearch:focus { 130 | opacity: .75; 131 | } 132 | .gis_GeocoderDijit .esriGeocoder .esriGeocoderReset { 133 | margin: 6px 6px 6px 0; 134 | float: right; 135 | display: none; 136 | } 137 | .gis_GeocoderDijit .dj_rtl .esriGeocoder .esriGeocoderReset { 138 | margin: 6px 0 6px 6px; 139 | float: left; 140 | } 141 | .gis_GeocoderDijit .esriGeocoderHasValue .esriGeocoderReset { 142 | cursor: pointer; 143 | display: block; 144 | background: url(../images/geocoder.png) no-repeat -48px 0; 145 | } 146 | .gis_GeocoderDijit .esriGeocoderLoading .esriGeocoderReset { 147 | background: url(../images/loading.gif) center center no-repeat; 148 | } 149 | .gis_GeocoderDijit .esriGeocoder .esriGeocoderReset:hover, .gis_GeocoderDijit .esriGeocoder .esriGeocoderReset:focus { 150 | opacity: .75; 151 | } 152 | .gis_GeocoderDijit .esriGeocoder .esriGeocoderMenuArrow { 153 | display: none; 154 | cursor: pointer; 155 | background: url(../images/geocoder.png) no-repeat -32px 0; 156 | } 157 | .gis_GeocoderDijit .esriGeocoderMultiple .esriGeocoderMenuArrow { 158 | display: block; 159 | } 160 | .gis_GeocoderDijit .esriGeocoder .esriGeocoderMenuArrow:hover, .gis_GeocoderDijit .esriGeocoder .esriGeocoderMenuArrow:focus { 161 | opacity: .75; 162 | } 163 | .gis_GeocoderDijit .esriGeocoderResults { 164 | display: none; 165 | z-index: 99; 166 | width: 225px; 167 | position: absolute; 168 | left: 0; 169 | top: 100%; 170 | margin: -3px 0 0 -31px; 171 | border: 1px solid #57585A; 172 | border-top: 0; 173 | padding: 0; 174 | background: #fff; 175 | -webkit-border-radius: 0 0 5px 5px; 176 | border-radius: 0 0 5px 5px; 177 | } 178 | .gis_GeocoderDijit .esriGeocoderResult { 179 | padding: 6px; 180 | display: block; 181 | cursor: pointer; 182 | outline: 0; 183 | white-space: nowrap; 184 | overflow: hidden; 185 | text-overflow: ellipsis; 186 | -o-text-overflow: ellipsis; 187 | } 188 | .gis_GeocoderDijit .esriGeocoderResultOdd {} .gis_GeocoderDijit .esriGeocoderResult:hover, .esriGeocoderResultEven:focus, .esriGeocoderResultOdd:focus { 189 | background-color: #ededed; 190 | } 191 | .gis_GeocoderDijit .esriGeocoderResultLast { 192 | -webkit-border-radius: 0 0 5px 5px; 193 | border-radius: 0 0 5px 5px; 194 | } 195 | .gis_GeocoderDijit .esriGeocoderResult .esriGeocoderResultPartial { 196 | font-weight: 700; 197 | } 198 | .gis_GeocoderDijit .esriGeocoderMenu { 199 | display: none; 200 | width: 100%; 201 | z-index: 99; 202 | position: absolute; 203 | left: 0; 204 | top: 100%; 205 | margin: 0 0 0 -2px; 206 | padding: 0; 207 | background: #fff; 208 | border: 1px solid #57585A; 209 | border-top: 0; 210 | -webkit-border-radius: 0 0 5px 5px; 211 | border-radius: 0 0 5px 5px; 212 | } 213 | .gis_GeocoderDijit .dj_rtl .esriGeocoderMenu, .gis_GeocoderDijit .dj_rtl .esriGeocoderResults { 214 | left: auto; 215 | right: 0; 216 | } 217 | .gis_GeocoderDijit .esriGeocoderMenu .esriGeocoderMenuHeader { 218 | padding: 6px; 219 | margin: 0; 220 | display: block; 221 | background: #666; 222 | color: #fff; 223 | font-weight: 700; 224 | } 225 | .gis_GeocoderDijit .esriGeocoderMenu .esriGeocoderMenuClose { 226 | display: block; 227 | float: right; 228 | width: 16px; 229 | height: 16px; 230 | background: url(../images/geocoder.png) no-repeat -64px 0; 231 | cursor: pointer; 232 | outline: 0; 233 | } 234 | .gis_GeocoderDijit .dj_rtl .esriGeocoderMenu .esriGeocoderMenuClose { 235 | float: left; 236 | } 237 | .gis_GeocoderDijit .esriGeocoderMenu .esriGeocoderMenuClose:hover, .gis_GeocoderDijit .esriGeocoderMenu .esriGeocoderMenuClose:focus { 238 | opacity: .75; 239 | } 240 | .gis_GeocoderDijit .esriGeocoderMenu .esriGeocoderSelectedCheck { 241 | width: 16px; 242 | height: 16px; 243 | display: block; 244 | float: right; 245 | margin: 0 0 0 6px; 246 | } 247 | .gis_GeocoderDijit .dj_rtl .esriGeocoderMenu .esriGeocoderSelectedCheck { 248 | float: left; 249 | margin: 0 6px 0 0; 250 | } 251 | .gis_GeocoderDijit .esriGeocoderMenu .esriGeocoderSelected .esriGeocoderSelectedCheck { 252 | background: url(../images/geocoder.png) no-repeat -16px 0; 253 | } 254 | -------------------------------------------------------------------------------- /js/gis/dijit/Geocoder/images/geocoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Geocoder/images/geocoder.png -------------------------------------------------------------------------------- /js/gis/dijit/Geocoder/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Geocoder/images/loading.gif -------------------------------------------------------------------------------- /js/gis/dijit/Geocoder/templates/Geocoder.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /js/gis/dijit/Growler.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/_WidgetBase', 4 | 'dijit/_TemplatedMixin', 5 | 'dojo/_base/lang', 6 | 'dojo/dom-style', 7 | 'dojo/dom-construct', 8 | 'dojo/_base/fx', 9 | 'dojo/dom-class', 10 | 'dojo/topic', 11 | 'xstyle/css!./Growler/css/Growler.css' 12 | ], function (declare, _WidgetBase, _TemplatedMixin, lang, Style, domConstruct, fx, domClass, topic) { 13 | 14 | // main growler dijit container 15 | var Growler = declare([_WidgetBase, _TemplatedMixin], { 16 | templateString: '
', 17 | postCreate: function () { 18 | this.inherited(arguments); 19 | this.own(topic.subscribe('growler/growl', lang.hitch(this, 'growl'))); 20 | }, 21 | growl: function (props) { 22 | props = props || {}; 23 | lang.mixin(props, { 24 | _container: this.containerNode 25 | }); 26 | var g = new Growl(props); 27 | g.startup(); 28 | } 29 | }); 30 | 31 | // the growl itself 32 | var Growl = declare([_WidgetBase, _TemplatedMixin], { 33 | templateString: '

${title}

${message}
', 34 | title: 'Title', 35 | message: 'Message', 36 | level: 'default', 37 | timeout: 10000, 38 | opacity: 1.0, 39 | _container: null, 40 | _timer: null, 41 | postCreate: function () { 42 | this.inherited(arguments); 43 | if (this._container) { 44 | Style.set(this.domNode, 'opacity', 0); 45 | domConstruct.place(this.domNode, this._container); 46 | fx.anim(this.domNode, { 47 | opacity: this.opacity 48 | }, 250); 49 | this.setTimeout(); 50 | } else { 51 | topic.publish('viewer/handleError', { 52 | source: 'Growler', 53 | error: 'Growl container not found/specified.' 54 | }); 55 | } 56 | }, 57 | setTimeout: function () { 58 | if (this.timeout > 0) { 59 | this._timer = setTimeout(lang.hitch(this, 'close'), this.timeout); 60 | } 61 | }, 62 | hoverOver: function () { 63 | clearInterval(this._timer); 64 | domClass.add(this.domNode, 'hover'); 65 | }, 66 | hoverOut: function () { 67 | if (this.timeout > 0) { 68 | this.setTimeout(); 69 | } 70 | domClass.remove(this.domNode, 'hover'); 71 | }, 72 | close: function () { 73 | fx.anim(this.domNode, { 74 | opacity: 0 75 | }, 500, null, lang.hitch(this, 'remove')); 76 | }, 77 | remove: function () { 78 | fx.anim(this.domNode, { 79 | height: 0, 80 | margin: 0 81 | }, 250, null, lang.partial(domConstruct.destroy, this.domNode)); 82 | } 83 | }); 84 | return Growler; 85 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Growler/css/Growler.css: -------------------------------------------------------------------------------- 1 | .gis-dijit-Growl .growl { 2 | cursor: pointer; 3 | font-size: 0.9em; 4 | margin-right: 1px; 5 | margin-bottom: 10px; 6 | padding: 8px 14px 8px 14px; 7 | margin-bottom: 10px; 8 | text-shadow: 0 1px 0 rgba(255,255,255,0.5); 9 | background-color: #fcf8e3; 10 | border: 1px solid #fbefd6; 11 | -webkit-border-radius: 4px; 12 | border-radius: 4px; 13 | color: #c09853; 14 | } 15 | 16 | .gis-dijit-Growl .growl h1,.gis-dijit-Growl .growl h2,.gis-dijit-Growl .growl h3,.gis-dijit-Growl .growl h4 { 17 | margin: 0; 18 | } 19 | 20 | .gis-dijit-Growl .growl.warning { 21 | background-color: #fcf8e3; 22 | border-color: #fbefd6; 23 | color: #c09853; 24 | } 25 | 26 | .gis-dijit-Growl .growl.success { 27 | background-color: #dff0d8; 28 | border-color: #d7eac8; 29 | color: #468847; 30 | } 31 | 32 | .gis-dijit-Growl .growl.error { 33 | background-color: #f2dede; 34 | border-color: #eed4d8; 35 | color: #b94a48; 36 | } 37 | 38 | .gis-dijit-Growl .growl.info { 39 | background-color: #d9edf7; 40 | border-color: #bee9f1; 41 | color: #3a87ad; 42 | } 43 | 44 | .gis-dijit-Growl .growl.default { 45 | background-color: #333333; 46 | border-color: #7A7A7A; 47 | color: white; 48 | text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); 49 | } 50 | -------------------------------------------------------------------------------- /js/gis/dijit/Help.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/_WidgetBase', 4 | 'dijit/_TemplatedMixin', 5 | 'dijit/_WidgetsInTemplateMixin', 6 | 'gis/dijit/_FloatingWidgetMixin', 7 | 'dojo/dom-construct', 8 | 'dojo/on', 9 | 'dojo/_base/lang', 10 | 'dojo/aspect', 11 | 'dojo/text!./Help/templates/HelpDialog.html', 12 | 'dijit/form/Button', 13 | 'dijit/layout/TabContainer', 14 | 'dijit/layout/ContentPane', 15 | 'xstyle/css!./Help/css/Help.css' 16 | ], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _FloatingWidgetMixin, domConstruct, on, lang, aspect, template) { 17 | 18 | return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _FloatingWidgetMixin], { 19 | widgetsInTemplate: true, 20 | templateString: template, 21 | title: 'Help', 22 | html: 'Help', 23 | domTarget: 'helpDijit', 24 | draggable: false, 25 | baseClass: 'helpDijit', 26 | postCreate: function () { 27 | this.inherited(arguments); 28 | this.parentWidget.draggable = this.draggable; 29 | if (this.parentWidget.toggleable) { 30 | this.own(aspect.after(this.parentWidget, 'toggle', lang.hitch(this, function () { 31 | this.containerNode.resize(); 32 | }))); 33 | } else { 34 | var help = domConstruct.place(this.html, this.domTarget); 35 | on(help, 'click', lang.hitch(this.parentWidget, 'show')); 36 | } 37 | }, 38 | onOpen: function () { 39 | // Make sure the content is visible when the dialog 40 | // is shown/opened. Something like this may be needed 41 | // for all floating windows that don't open on startup? 42 | this.containerNode.resize(); 43 | }, 44 | close: function () { 45 | if (this.parentWidget.hide) { 46 | this.parentWidget.hide(); 47 | } 48 | } 49 | }); 50 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Help/css/Help.css: -------------------------------------------------------------------------------- 1 | .helpDijit .listdbootstrapFix{ 2 | padding: 0 0 0 25px; 3 | } 4 | 5 | .helpDijit .helpContainer { 6 | padding: 0px; 7 | } 8 | .floatingWidget .helpDijit .helpContainer { 9 | padding: 5px; 10 | } 11 | .helpDijit .helpNode { 12 | width: 98%; 13 | height: 325px; 14 | } 15 | .floatingWidget .helpDijit .helpNode { 16 | width: 450px; 17 | } 18 | .helpDijit .helpTabContainer { 19 | width: 100%; 20 | height: 100%; 21 | } -------------------------------------------------------------------------------- /js/gis/dijit/Help/images/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Help/images/help.png -------------------------------------------------------------------------------- /js/gis/dijit/Help/templates/HelpDialog.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 | 44 | 45 | 46 |
10 | Map navigation using mouse and keyboard: 11 |
    12 |
  • 13 | Drag to pan 14 |
  • 15 |
  • 16 | SHIFT + Click to recenter 17 |
  • 18 |
  • 19 | SHIFT + Drag to zoom in 20 |
  • 21 |
  • 22 | SHIFT + CTRL + Drag to zoom out 23 |
  • 24 |
  • 25 | Mouse Scroll Forward to zoom in 26 |
  • 27 |
  • 28 | Mouse Scroll Backward to zoom out 29 |
  • 30 |
  • 31 | Use Arrow keys to pan 32 |
  • 33 |
  • 34 | + key to zoom in a level 35 |
  • 36 |
  • 37 | - key to zoom out a level 38 |
  • 39 |
  • 40 | Double Click to Center and Zoom in 41 |
  • 42 |
43 |
47 |
48 |
49 | A variety of searches can be performed in the search box: 50 |
    51 |
  • 52 | Search by Address 53 |
  • 54 |
  • 55 | Search by Place Name 56 |
  • 57 |
  • 58 | Search By Zip Code, County, etc. 59 |
  • 60 |
61 |
62 |
63 | In addition to Search capabilities, the following tools are provided: 64 |
    65 |
  • 66 | Measure 67 |
  • 68 |
    69 | The measure tool provides the capabilities to draw a point, line, or polygon 70 | on the map and specify the unit of measurement. 71 |
    72 |
  • 73 | Print 74 |
  • 75 |
    76 | This map can be exported to varouis formats and layouts 77 |
    78 |
79 |
80 |
81 |
82 |
83 |
84 | -------------------------------------------------------------------------------- /js/gis/dijit/Identify/css/Identify.css: -------------------------------------------------------------------------------- 1 | .gis_IdentifyDijit { 2 | width: 100%; 3 | } 4 | .floatingWidget .gis_IdentifyDijit .formContainer { 5 | min-width: 300px; 6 | padding: 10px; 7 | } 8 | .gis_IdentifyDijit .identifySelect { 9 | width:100%; 10 | margin-top: 5px; 11 | } 12 | 13 | .esriPopup .loading { 14 | height:20px; 15 | width:20px; 16 | margin:0px; 17 | background-image: url('../images/loading.gif'); 18 | background-size: 20px 20px; 19 | } 20 | -------------------------------------------------------------------------------- /js/gis/dijit/Identify/images/identify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Identify/images/identify.png -------------------------------------------------------------------------------- /js/gis/dijit/Identify/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Identify/images/loading.gif -------------------------------------------------------------------------------- /js/gis/dijit/Identify/templates/Identify.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 7 |
8 |
9 |
10 | -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/README.md: -------------------------------------------------------------------------------- 1 | ## Layer Control 2 | 3 | A layer control widget for CMV. Just don't call it a TOC. 4 | 5 | ### Features 6 | 7 | * Toggle layer visibility 8 | * Layer menu with Zoom To Layer, Transparency and Layer Swipe 9 | * Legends for ArcGIS layers 10 | * Sublayer/folder structure and toggling for ArcGIS dynamic layers 11 | * can be disabled 12 | * single layer map services display legend in expand area 13 | * Layer reordering in map and LayerControl widget 14 | * Separate vector and overlay layers (required for layer reordering) 15 | * Support for several layer types: 16 | * dynamic 17 | * feature 18 | * tiled 19 | * image 20 | 21 | ### LayerControl Class 22 | 23 | #### Adding Layer Control to CMV 24 | 25 | 1. Copy `layerControl.js` and `LayerControl` folder into `js/gis/dijit/` directory. 26 | 2. Add the widget configuration object to the `widgets` object in `viewer.js`. 27 | 3. Additional options can be passed with each layer via the `controlOptions` object. See Layer Options for said options. 28 | 29 | **Widget Configuration** 30 | 31 | ``` javascript 32 | layerControl: { 33 | include: true, 34 | id: 'layerControl', 35 | type: 'titlePane', 36 | path: 'gis/dijit/LayerControl', 37 | title: 'Layers', 38 | open: true, 39 | position: 0, 40 | options: { 41 | map: true, //required 42 | layerControlLayerInfos: true //required 43 | } 44 | } 45 | ``` 46 | 47 | #### Additional Widget Options 48 | 49 | | Option | Type | Description | 50 | | :----: | :--: | ----------- | 51 | | `separated` | Boolean | Separate vector and overlay layer types. Required for `vectorReorder`, `vectorLabel`, `overlayReorder` and `overlayLabel`. Default is `false`. | 52 | | `vectorReorder` | Boolean | Enable reordering of vector layers in map and Layer Control. Default is `false`. | 53 | | `vectorLabel` | Mixed | Label for vector layers. Default is `false`. Pass the label or html for quick easy custom styling of label text. | 54 | | `overlayReorder` | Boolean | Enable reordering of overlay layers in map and Layer Control. Default is `false`. | 55 | | `overlayLabel` | Mixed | Label for overlay layers. Default is `false`. Pass the label or html for quick easy custom styling of label text. | 56 | | `noLegend` | Boolean | When `true` no legend is created for all layers. Can be overridden for specific layer(s) with `noLegend' layer option. | 57 | | `noZoom` | Boolean | When `true` removes "Zoom to Layer" menu item for all layers. Can be overridden for specific layer(s) with `noZoom' layer option. | 58 | | `noTransparency` | Boolean | When `true` removes "Transparency" menu item for all layers. Can be overridden for specific layer(s) with `noTransparency' layer option. | 59 | | `swipe` | Boolean | When `true` adds "Layer Swipe" menu item for all layers. Can be overridden for specific layer(s) with `swipe` layer option. | 60 | | `swiperButtonStyle` | String | CSS for positioning "Exit Layer Swipe" button in the map. Must include `position:absolute;` and a `z-index`. Default is `position:absolute;top:20px;left:120px;z-index:50;`. | 61 | | `fontAwesome` | Boolean | Load Font Awesome CSS. Because dbootstrap uses FA v3.x it is necessary to load FA v4.x. Default is `true`. This can be set to `false` if FA v4.x is being loaded with a `link` tag in `index.html` or as a font. | 62 | | `fontAwesomeUrl` | String | CDN URL from which to load Font Awesome. Default is FA v4.2.0 from the BootstrapCDN. | 63 | 64 | ### Layer Options 65 | 66 | Additional options can be passed with each layer via the `layerControlLayerInfos` object. All layer types have common options while some options are specific to certain layer types. All `controlOptions` are Boolean. 67 | 68 | | Option | Description | Affects | 69 | | :----: | ----------- | ------- | 70 | | `exclude` | When `true` a layer control will not be added to the widget. Using `exclude` for a layer with layer reordering enabled which is not above or below all included layers will result in layer reordering issues. | all layers | 71 | | `noLegend` | When `true` no legend is created. Set to `false` to override `noLegend: true` widget option. | dynamic, feature and tiled | 72 | | `noZoom` | When `true` removes "Zoom to Layer" menu item. Set to `false` to override `noZoom: true` widget option. | all layers | 73 | | `noTransparency` | When `true` removes "Transparency" menu item. Set to `false` to override `noTransparency: true` widget option. | all layers | 74 | | `swipe` | When `true` adds "Layer Swipe" menu item. Set to `false` to override `swipe: true` widget option. | all layers | 75 | | `swipeScope` | When `true` adds Scope option to Layer Swipe menu. Default is `false`. | 76 | | `expanded` | When `true` expands top level exposing sublayers or legend. | dynamic, feature & tiled | 77 | | `sublayers` | When `true` dynamic folder/sublayer structure is not created. | dynamic | 78 | 79 | #### Dynamic Example 80 | 81 | ``` javascript 82 | { 83 | type: 'dynamic', 84 | url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', 85 | title: 'Louisville Public Safety', 86 | options: { 87 | //layer options 88 | }, 89 | layerControlLayerInfos: { 90 | sublayers: false, 91 | noTransparency: true 92 | } 93 | } 94 | ``` 95 | 96 | #### Feature Example 97 | 98 | ``` javascript 99 | { 100 | type: 'feature', 101 | url: 'http://services1.arcgis.com/g2TonOxuRkIqSOFx/arcgis/rest/services/MeetUpHomeTowns/FeatureServer/0', 102 | title: 'STLJS Meetup Home Towns', 103 | options: { 104 | //layer options 105 | }, 106 | layerControlLayerInfos: { 107 | noLegend: true, 108 | noZoom: true 109 | } 110 | } 111 | ``` 112 | 113 | ### Topics 114 | 115 | Subscribe to any of the following topics. CMV aims to please, so let us know if you would like a topic published for a particular user action, or layer/layer control state change. 116 | 117 | `layerControl/layerToggle` is published when layer visibility changes via the layer checkbox. 118 | 119 | ```javascript 120 | topic.subscribe('layerControl/layerToggle', function (r) { 121 | console.log(r.id); //layer id 122 | console.log(r.visible); //layer visibility (true/false) 123 | }); 124 | ``` 125 | 126 | `layerControl/setVisibleLayers` is published when visible layers are set on a dynamic layer. 127 | 128 | ```javascript 129 | topic.subscribe('layerControl/setVisibleLayers', function (r) { 130 | console.log(r.id); //layer id 131 | console.log(r.visibleLayers); //array of set visible layer ids 132 | }); 133 | ``` 134 | 135 | #### Layer Control TODO 136 | 137 | Do not include this section is docs outside this file. 138 | 139 | 1. Support all layer types CMV supports (csv, kml, stream, wms) 140 | 2. More topics published 141 | 3. Method by which to add custom layer menu items 142 | 4. ~~Single legend module~~ 143 | 5. Users' suggestions for improvements 144 | 6. ~~Support pre 10.1 (10.2 in the case of image) legends with arcgis.com legend tool~~ 145 | 7. ~~Add 'scope' layer swipe type~~ 146 | 8. Optional plugin to set image layer rendering properties (`setBandIds`, `setMosaicRule`, etc) 147 | 9. ~~If dynamic `sublayers: false` but legend would otherwise be created build tiled style legend and place in `expandNode`~~ 148 | -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/DynamicFolder.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 'dojo/_base/array', 5 | 'dojo/on', 6 | 'dojo/dom-class', 7 | 'dojo/dom-style', 8 | 'dojo/dom-attr', 9 | 'dojo/html', 10 | 'dijit/_WidgetBase', 11 | 'dijit/_TemplatedMixin', 12 | 'dojo/text!./templates/Folder.html' 13 | ], function ( 14 | declare, 15 | lang, 16 | array, 17 | on, 18 | domClass, 19 | domStyle, 20 | domAttr, 21 | html, 22 | WidgetBase, 23 | TemplatedMixin, 24 | folderTemplate 25 | ) { 26 | return declare([WidgetBase, TemplatedMixin], { 27 | control: null, 28 | folderInfo: null, 29 | // ^args 30 | templateString: folderTemplate, 31 | postCreate: function () { 32 | this.inherited(arguments); 33 | if (array.indexOf(this.control.layer.visibleLayers, this.folderInfo.id) !== -1) { 34 | domClass.remove(this.checkNode, 'fa-square-o'); 35 | domClass.add(this.checkNode, 'fa fa-check-square-o'); 36 | domAttr.set(this.checkNode, 'data-checked', 'checked'); 37 | } else { 38 | domAttr.set(this.checkNode, 'data-checked', 'unchecked'); 39 | } 40 | domAttr.set(this.checkNode, 'data-sublayer-id', this.folderInfo.id); 41 | domClass.add(this.checkNode, this.control.layer.id + '-layerControlSublayerCheck'); 42 | on(this.checkNode, 'click', lang.hitch(this, function () { 43 | if (domAttr.get(this.checkNode, 'data-checked') === 'checked') { 44 | domAttr.set(this.checkNode, 'data-checked', 'unchecked'); 45 | domClass.remove(this.checkNode, 'fa-check-square-o'); 46 | domClass.add(this.checkNode, 'fa-square-o'); 47 | } else { 48 | domAttr.set(this.checkNode, 'data-checked', 'checked'); 49 | domClass.remove(this.checkNode, 'fa-square-o'); 50 | domClass.add(this.checkNode, 'fa-check-square-o'); 51 | } 52 | this.control._setVisibleLayers(); 53 | this._checkboxScaleRange(); 54 | })); 55 | html.set(this.labelNode, this.folderInfo.name); 56 | on(this.expandClickNode, 'click', lang.hitch(this, function () { 57 | var expandNode = this.expandNode, 58 | iconNode = this.expandIconNode; 59 | if (domStyle.get(expandNode, 'display') === 'none') { 60 | domStyle.set(expandNode, 'display', 'block'); 61 | domClass.remove(iconNode, 'fa-folder-o'); 62 | domClass.add(iconNode, 'fa-folder-open-o'); 63 | } else { 64 | domStyle.set(expandNode, 'display', 'none'); 65 | domClass.remove(iconNode, 'fa-folder-open-o'); 66 | domClass.add(iconNode, 'fa-folder-o'); 67 | } 68 | })); 69 | if (this.folderInfo.minScale !== 0 || this.folderInfo.maxScale !== 0) { 70 | this._checkboxScaleRange(); 71 | this.control.layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 72 | } 73 | }, 74 | // check scales and add/remove disabled classes from checkbox 75 | _checkboxScaleRange: function () { 76 | var node = this.checkNode, 77 | scale = this.control.layer.getMap().getScale(), 78 | min = this.folderInfo.minScale, 79 | max = this.folderInfo.maxScale; 80 | domClass.remove(node, 'layerControlCheckIconOutScale'); 81 | if ((min !== 0 && scale > min) || (max !== 0 && scale < max)) { 82 | domClass.add(node, 'layerControlCheckIconOutScale'); 83 | } 84 | } 85 | }); 86 | }); -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/DynamicSublayer.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 'dojo/_base/array', 5 | 'dojo/on', 6 | 'dojo/dom-class', 7 | 'dojo/dom-style', 8 | 'dojo/dom-attr', 9 | 'dojo/html', 10 | 'dijit/_WidgetBase', 11 | 'dijit/_TemplatedMixin', 12 | 'dojo/text!./templates/Sublayer.html' 13 | ], function ( 14 | declare, 15 | lang, 16 | array, 17 | on, 18 | domClass, 19 | domStyle, 20 | domAttr, 21 | html, 22 | WidgetBase, 23 | TemplatedMixin, 24 | sublayerTemplate 25 | ) { 26 | return declare([WidgetBase, TemplatedMixin], { 27 | control: null, 28 | sublayerInfo: null, 29 | // ^args 30 | templateString: sublayerTemplate, 31 | _expandClickHandler: null, 32 | postCreate: function () { 33 | this.inherited(arguments); 34 | if (array.indexOf(this.control.layer.visibleLayers, this.sublayerInfo.id) !== -1) { 35 | domClass.remove(this.checkNode, 'fa-square-o'); 36 | domClass.add(this.checkNode, 'fa fa-check-square-o'); 37 | domAttr.set(this.checkNode, 'data-checked', 'checked'); 38 | } else { 39 | domAttr.set(this.checkNode, 'data-checked', 'unchecked'); 40 | } 41 | domAttr.set(this.checkNode, 'data-sublayer-id', this.sublayerInfo.id); 42 | domClass.add(this.checkNode, this.control.layer.id + '-layerControlSublayerCheck'); 43 | on(this.checkNode, 'click', lang.hitch(this, function () { 44 | if (domAttr.get(this.checkNode, 'data-checked') === 'checked') { 45 | domAttr.set(this.checkNode, 'data-checked', 'unchecked'); 46 | domClass.remove(this.checkNode, 'fa-check-square-o'); 47 | domClass.add(this.checkNode, 'fa-square-o'); 48 | } else { 49 | domAttr.set(this.checkNode, 'data-checked', 'checked'); 50 | domClass.remove(this.checkNode, 'fa-square-o'); 51 | domClass.add(this.checkNode, 'fa-check-square-o'); 52 | } 53 | this.control._setVisibleLayers(); 54 | this._checkboxScaleRange(); 55 | })); 56 | html.set(this.labelNode, this.sublayerInfo.name); 57 | this._expandClick(); 58 | if (this.sublayerInfo.minScale !== 0 || this.sublayerInfo.maxScale !== 0) { 59 | this._checkboxScaleRange(); 60 | this.control.layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 61 | } 62 | }, 63 | // add on event to expandClickNode 64 | _expandClick: function () { 65 | this._expandClickHandler = on(this.expandClickNode, 'click', lang.hitch(this, function () { 66 | var expandNode = this.expandNode, 67 | iconNode = this.expandIconNode; 68 | if (domStyle.get(expandNode, 'display') === 'none') { 69 | domStyle.set(expandNode, 'display', 'block'); 70 | domClass.replace(iconNode, 'fa-minus-square-o', 'fa-plus-square-o'); 71 | } else { 72 | domStyle.set(expandNode, 'display', 'none'); 73 | domClass.replace(iconNode, 'fa-plus-square-o', 'fa-minus-square-o'); 74 | } 75 | })); 76 | }, 77 | // check scales and add/remove disabled classes from checkbox 78 | _checkboxScaleRange: function () { 79 | var node = this.checkNode, 80 | scale = this.control.layer.getMap().getScale(), 81 | min = this.sublayerInfo.minScale, 82 | max = this.sublayerInfo.maxScale; 83 | domClass.remove(node, 'layerControlCheckIconOutScale'); 84 | if ((min !== 0 && scale > min) || (max !== 0 && scale < max)) { 85 | domClass.add(node, 'layerControlCheckIconOutScale'); 86 | } 87 | } 88 | }); 89 | }); -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/Feature.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 'dojo/topic', 5 | 'dojo/on', 6 | 'dojo/dom-class', 7 | 'dojo/dom-style', 8 | 'dojo/dom-construct', 9 | 'dojo/html', 10 | 'dijit/_WidgetBase', 11 | 'dijit/_TemplatedMixin', 12 | 'dijit/_Contained', 13 | './../plugins/LayerMenu', 14 | './../plugins/legendUtil', 15 | 'dojo/text!./templates/Control.html' 16 | ], function ( 17 | declare, 18 | lang, 19 | topic, 20 | on, 21 | domClass, 22 | domStyle, 23 | domConst, 24 | html, 25 | WidgetBase, 26 | TemplatedMixin, 27 | Contained, 28 | LayerMenu, 29 | legendUtil, 30 | controlTemplate 31 | ) { 32 | return declare([WidgetBase, TemplatedMixin, Contained], { 33 | controller: null, 34 | layer: null, 35 | layerTitle: 'Layer Title', 36 | controlOptions: null, 37 | // ^args 38 | templateString: controlTemplate, 39 | layerMenu: null, 40 | _layerType: 'vector', 41 | _scaleRangeHandler: null, 42 | _expandClickHandler: null, 43 | _reorderUp: null, // used by LayerMenu 44 | _reorderDown: null, // used by LayerMenu 45 | postCreate: function () { 46 | this.inherited(arguments); 47 | if (!this.controller) { 48 | topic.publish('viewer/handleError', { 49 | source: 'LayerControl/Feature', 50 | error: 'controller option is required' 51 | }); 52 | this.destroy(); 53 | return; 54 | } 55 | if (!this.layer) { 56 | topic.publish('viewer/handleError', { 57 | source: 'LayerControl/Feature', 58 | error: 'layer option is required' 59 | }); 60 | this.destroy(); 61 | return; 62 | } 63 | if (this.layer.loaded) { 64 | this._initialize(); 65 | } else { 66 | this.layer.on('load', lang.hitch(this, '_initialize')); 67 | } 68 | }, 69 | // add layer and init control 70 | _initialize: function () { 71 | var layer = this.layer, 72 | controlOptions = this.controlOptions, 73 | isLegend = legendUtil.isLegend(controlOptions.noLegend, this.controller.noLegend); 74 | // template defaults as unchecked if visible checked 75 | if (layer.visible) { 76 | domClass.remove(this.checkNode, 'fa-square-o'); 77 | domClass.add(this.checkNode, 'fa fa-check-square-o'); 78 | } 79 | // toggle layer 80 | on(this.checkNode, 'click', lang.hitch(this, function () { 81 | if (layer.visible) { 82 | layer.hide(); 83 | domClass.remove(this.checkNode, 'fa-check-square-o'); 84 | domClass.add(this.checkNode, 'fa-square-o'); 85 | topic.publish('layerControl/layerToggle', { 86 | id: layer.id, 87 | visible: layer.visible 88 | }); 89 | } else { 90 | layer.show(); 91 | domClass.remove(this.checkNode, 'fa-square-o'); 92 | domClass.add(this.checkNode, 'fa-check-square-o'); 93 | topic.publish('layerControl/layerToggle', { 94 | id: layer.id, 95 | visible: layer.visible 96 | }); 97 | } 98 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 99 | this._checkboxScaleRange(); 100 | } 101 | })); 102 | // set title 103 | html.set(this.labelNode, this.layerTitle); 104 | // wire up updating indicator 105 | layer.on('update-start', lang.hitch(this, function () { 106 | domStyle.set(this.layerUpdateNode, 'display', 'inline-block'); //font awesome display 107 | })); 108 | layer.on('update-end', lang.hitch(this, function () { 109 | domStyle.set(this.layerUpdateNode, 'display', 'none'); 110 | })); 111 | // layer menu 112 | this.layerMenu = new LayerMenu({ 113 | control: this, 114 | contextMenuForWindow: false, 115 | targetNodeIds: [this.labelNode], 116 | leftClickToOpen: true 117 | }); 118 | this.layerMenu.startup(); 119 | // create legend 120 | if (isLegend) { 121 | this._expandClick(); 122 | legendUtil.vectorLegend(layer, this.expandNode); 123 | } else { 124 | domClass.remove(this.expandIconNode, ['fa', 'fa-plus-square-o', 'layerControlToggleIcon']); 125 | domStyle.set(this.expandClickNode, 'cursor', 'default'); 126 | domConst.destroy(this.expandNode); 127 | } 128 | //show expandNode 129 | if (controlOptions.expanded) { 130 | this.expandClickNode.click(); 131 | } 132 | // if layer has scales set 133 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 134 | this._checkboxScaleRange(); 135 | this._scaleRangeHandler = layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 136 | } 137 | // if layer scales change 138 | this.layer.on('scale-range-change', lang.hitch(this, function () { 139 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 140 | this._checkboxScaleRange(); 141 | this._scaleRangeHandler = layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 142 | } else { 143 | this._checkboxScaleRange(); 144 | if (this._scaleRangeHandler) { 145 | this._scaleRangeHandler.remove(); 146 | this._scaleRangeHandler = null; 147 | } 148 | } 149 | })); 150 | }, 151 | // add on event to expandClickNode 152 | _expandClick: function () { 153 | this._expandClickHandler = on(this.expandClickNode, 'click', lang.hitch(this, function () { 154 | var expandNode = this.expandNode, 155 | iconNode = this.expandIconNode; 156 | if (domStyle.get(expandNode, 'display') === 'none') { 157 | domStyle.set(expandNode, 'display', 'block'); 158 | domClass.replace(iconNode, 'fa-minus-square-o', 'fa-plus-square-o'); 159 | } else { 160 | domStyle.set(expandNode, 'display', 'none'); 161 | domClass.replace(iconNode, 'fa-plus-square-o', 'fa-minus-square-o'); 162 | } 163 | })); 164 | }, 165 | // check scales and add/remove disabled classes from checkbox 166 | _checkboxScaleRange: function () { 167 | var node = this.checkNode, 168 | layer = this.layer, 169 | scale = layer.getMap().getScale(), 170 | min = layer.minScale, 171 | max = layer.maxScale; 172 | domClass.remove(node, 'layerControlCheckIconOutScale'); 173 | if ((min !== 0 && scale > min) || (max !== 0 && scale < max)) { 174 | domClass.add(node, 'layerControlCheckIconOutScale'); 175 | } 176 | } 177 | }); 178 | }); -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/Image.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 'dojo/topic', 5 | 'dojo/on', 6 | 'dojo/dom-construct', 7 | 'dojo/dom-class', 8 | 'dojo/dom-style', 9 | 'dojo/html', 10 | 'dijit/_WidgetBase', 11 | 'dijit/_TemplatedMixin', 12 | 'dijit/_Contained', 13 | './../plugins/LayerMenu', 14 | './../plugins/legendUtil', 15 | 'dojo/text!./templates/Control.html' 16 | ], function ( 17 | declare, 18 | lang, 19 | topic, 20 | on, 21 | domConst, 22 | domClass, 23 | domStyle, 24 | html, 25 | WidgetBase, 26 | TemplatedMixin, 27 | Contained, 28 | LayerMenu, 29 | legendUtil, 30 | controlTemplate 31 | ) { 32 | return declare([WidgetBase, TemplatedMixin, Contained], { 33 | controller: null, 34 | layer: null, 35 | layerTitle: 'Layer Title', 36 | controlOptions: null, 37 | // ^args 38 | templateString: controlTemplate, 39 | layerMenu: null, 40 | _layerType: 'overlay', 41 | _scaleRangeHandler: null, 42 | _reorderUp: null, // used by LayerMenu 43 | _reorderDown: null, // used by LayerMenu 44 | postCreate: function () { 45 | this.inherited(arguments); 46 | if (!this.controller) { 47 | topic.publish('viewer/handleError', { 48 | source: 'LayerControl/Image', 49 | error: 'controller option is required' 50 | }); 51 | this.destroy(); 52 | return; 53 | } 54 | if (!this.layer) { 55 | topic.publish('viewer/handleError', { 56 | source: 'LayerControl/Image', 57 | error: 'layer option is required' 58 | }); 59 | this.destroy(); 60 | return; 61 | } 62 | if (this.layer.loaded) { 63 | this._initialize(); 64 | } else { 65 | this.layer.on('load', lang.hitch(this, '_initialize')); 66 | } 67 | }, 68 | // add layer and init control 69 | _initialize: function () { 70 | var layer = this.layer, 71 | controlOptions = this.controlOptions, 72 | isLegend = legendUtil.isLegend(controlOptions.noLegend, this.controller.noLegend); 73 | // template defaults as unchecked if visible checked 74 | if (layer.visible) { 75 | domClass.remove(this.checkNode, 'fa-square-o'); 76 | domClass.add(this.checkNode, 'fa fa-check-square-o'); 77 | } 78 | // toggle layer 79 | on(this.checkNode, 'click', lang.hitch(this, function () { 80 | if (layer.visible) { 81 | layer.hide(); 82 | domClass.remove(this.checkNode, 'fa-check-square-o'); 83 | domClass.add(this.checkNode, 'fa-square-o'); 84 | topic.publish('layerControl/layerToggle', { 85 | id: layer.id, 86 | visible: layer.visible 87 | }); 88 | } else { 89 | layer.show(); 90 | domClass.remove(this.checkNode, 'fa-square-o'); 91 | domClass.add(this.checkNode, 'fa-check-square-o'); 92 | topic.publish('layerControl/layerToggle', { 93 | id: layer.id, 94 | visible: layer.visible 95 | }); 96 | } 97 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 98 | this._checkboxScaleRange(); 99 | } 100 | })); 101 | // set title 102 | html.set(this.labelNode, this.layerTitle); 103 | // wire up updating indicator 104 | layer.on('update-start', lang.hitch(this, function () { 105 | domStyle.set(this.layerUpdateNode, 'display', 'inline-block'); //font awesome display 106 | })); 107 | layer.on('update-end', lang.hitch(this, function () { 108 | domStyle.set(this.layerUpdateNode, 'display', 'none'); 109 | })); 110 | // create legend 111 | if (isLegend) { 112 | this._expandClick(); 113 | legendUtil.layerLegend(layer, this.expandNode); 114 | } else { 115 | domClass.remove(this.expandIconNode, ['fa', 'fa-plus-square-o', 'layerControlToggleIcon']); 116 | domStyle.set(this.expandClickNode, 'cursor', 'default'); 117 | domConst.destroy(this.expandNode); 118 | } 119 | // show expandNode 120 | if (controlOptions.expanded) { 121 | this.expandClickNode.click(); 122 | } 123 | //layer menu 124 | this.layerMenu = new LayerMenu({ 125 | control: this, 126 | contextMenuForWindow: false, 127 | targetNodeIds: [this.labelNode], 128 | leftClickToOpen: true 129 | }); 130 | this.layerMenu.startup(); 131 | //if layer has scales set 132 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 133 | this._checkboxScaleRange(); 134 | this._scaleRangeHandler = layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 135 | } 136 | //if layer scales change 137 | this.layer.on('scale-range-change', lang.hitch(this, function () { 138 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 139 | this._checkboxScaleRange(); 140 | this._scaleRangeHandler = layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 141 | } else { 142 | this._checkboxScaleRange(); 143 | if (this._scaleRangeHandler) { 144 | this._scaleRangeHandler.remove(); 145 | this._scaleRangeHandler = null; 146 | } 147 | } 148 | })); 149 | }, 150 | // add on event to expandClickNode 151 | _expandClick: function () { 152 | this._expandClickHandler = on(this.expandClickNode, 'click', lang.hitch(this, function () { 153 | var expandNode = this.expandNode, 154 | iconNode = this.expandIconNode; 155 | if (domStyle.get(expandNode, 'display') === 'none') { 156 | domStyle.set(expandNode, 'display', 'block'); 157 | domClass.replace(iconNode, 'fa-minus-square-o', 'fa-plus-square-o'); 158 | } else { 159 | domStyle.set(expandNode, 'display', 'none'); 160 | domClass.replace(iconNode, 'fa-plus-square-o', 'fa-minus-square-o'); 161 | } 162 | })); 163 | }, 164 | // check scales and add/remove disabled classes from checkbox 165 | _checkboxScaleRange: function () { 166 | var node = this.checkNode, 167 | layer = this.layer, 168 | scale = layer.getMap().getScale(), 169 | min = layer.minScale, 170 | max = layer.maxScale; 171 | domClass.remove(node, 'layerControlCheckIconOutScale'); 172 | if ((min !== 0 && scale > min) || (max !== 0 && scale < max)) { 173 | domClass.add(node, 'layerControlCheckIconOutScale'); 174 | } 175 | } 176 | }); 177 | }); -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/Tiled.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 'dojo/topic', 5 | 'dojo/on', 6 | 'dojo/dom-construct', 7 | 'dojo/dom-class', 8 | 'dojo/dom-style', 9 | 'dojo/html', 10 | 'dijit/_WidgetBase', 11 | 'dijit/_TemplatedMixin', 12 | 'dijit/_Contained', 13 | './../plugins/LayerMenu', 14 | './../plugins/legendUtil', 15 | 'dojo/text!./templates/Control.html' 16 | ], function ( 17 | declare, 18 | lang, 19 | topic, 20 | on, 21 | domConst, 22 | domClass, 23 | domStyle, 24 | html, 25 | WidgetBase, 26 | TemplatedMixin, 27 | Contained, 28 | LayerMenu, 29 | legendUtil, 30 | controlTemplate 31 | ) { 32 | return declare([WidgetBase, TemplatedMixin, Contained], { 33 | controller: null, 34 | layer: null, 35 | layerTitle: 'Layer Title', 36 | controlOptions: null, 37 | // ^args 38 | templateString: controlTemplate, 39 | layerMenu: null, 40 | _layerType: 'overlay', 41 | _scaleRangeHandler: null, 42 | _expandClickHandler: null, 43 | _reorderUp: null, // used by LayerMenu 44 | _reorderDown: null, // used by LayerMenu 45 | postCreate: function () { 46 | this.inherited(arguments); 47 | if (!this.controller) { 48 | topic.publish('viewer/handleError', { 49 | source: 'LayerControl/Tiled', 50 | error: 'controller option is required' 51 | }); 52 | this.destroy(); 53 | return; 54 | } 55 | if (!this.layer) { 56 | topic.publish('viewer/handleError', { 57 | source: 'LayerControl/Tiled', 58 | error: 'layer option is required' 59 | }); 60 | this.destroy(); 61 | return; 62 | } 63 | if (this.layer.loaded) { 64 | this._initialize(); 65 | } else { 66 | this.layer.on('load', lang.hitch(this, '_initialize')); 67 | } 68 | }, 69 | // add layer and init control 70 | _initialize: function () { 71 | var layer = this.layer, 72 | controlOptions = this.controlOptions, 73 | isLegend = legendUtil.isLegend(controlOptions.noLegend, this.controller.noLegend); 74 | // template defaults as unchecked if visible checked 75 | if (layer.visible) { 76 | domClass.remove(this.checkNode, 'fa-square-o'); 77 | domClass.add(this.checkNode, 'fa fa-check-square-o'); 78 | } 79 | // toggle layer 80 | on(this.checkNode, 'click', lang.hitch(this, function () { 81 | if (layer.visible) { 82 | layer.hide(); 83 | domClass.remove(this.checkNode, 'fa-check-square-o'); 84 | domClass.add(this.checkNode, 'fa-square-o'); 85 | topic.publish('layerControl/layerToggle', { 86 | id: layer.id, 87 | visible: layer.visible 88 | }); 89 | } else { 90 | layer.show(); 91 | domClass.remove(this.checkNode, 'fa-square-o'); 92 | domClass.add(this.checkNode, 'fa-check-square-o'); 93 | topic.publish('layerControl/layerToggle', { 94 | id: layer.id, 95 | visible: layer.visible 96 | }); 97 | } 98 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 99 | this._checkboxScaleRange(); 100 | } 101 | })); 102 | // set title 103 | html.set(this.labelNode, this.layerTitle); 104 | // wire up updating indicator 105 | layer.on('update-start', lang.hitch(this, function () { 106 | domStyle.set(this.layerUpdateNode, 'display', 'inline-block'); //font awesome display 107 | })); 108 | layer.on('update-end', lang.hitch(this, function () { 109 | domStyle.set(this.layerUpdateNode, 'display', 'none'); 110 | })); 111 | // create legend 112 | if (isLegend) { 113 | this._expandClick(); 114 | legendUtil.layerLegend(layer, this.expandNode); 115 | } else { 116 | domClass.remove(this.expandIconNode, ['fa', 'fa-plus-square-o', 'layerControlToggleIcon']); 117 | domStyle.set(this.expandClickNode, 'cursor', 'default'); 118 | domConst.destroy(this.expandNode); 119 | } 120 | // show expandNode 121 | if (controlOptions.expanded) { 122 | this.expandClickNode.click(); 123 | } 124 | // layer menu 125 | this.layerMenu = new LayerMenu({ 126 | control: this, 127 | contextMenuForWindow: false, 128 | targetNodeIds: [this.labelNode], 129 | leftClickToOpen: true 130 | }); 131 | this.layerMenu.startup(); 132 | // if layer has scales set 133 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 134 | this._checkboxScaleRange(); 135 | this._scaleRangeHandler = layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 136 | } 137 | // if layer scales change 138 | this.layer.on('scale-range-change', lang.hitch(this, function () { 139 | if (layer.minScale !== 0 || layer.maxScale !== 0) { 140 | this._checkboxScaleRange(); 141 | this._scaleRangeHandler = layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')); 142 | } else { 143 | this._checkboxScaleRange(); 144 | if (this._scaleRangeHandler) { 145 | this._scaleRangeHandler.remove(); 146 | this._scaleRangeHandler = null; 147 | } 148 | } 149 | })); 150 | }, 151 | // add on event to expandClickNode 152 | _expandClick: function () { 153 | this._expandClickHandler = on(this.expandClickNode, 'click', lang.hitch(this, function () { 154 | var expandNode = this.expandNode, 155 | iconNode = this.expandIconNode; 156 | if (domStyle.get(expandNode, 'display') === 'none') { 157 | domStyle.set(expandNode, 'display', 'block'); 158 | domClass.replace(iconNode, 'fa-minus-square-o', 'fa-plus-square-o'); 159 | } else { 160 | domStyle.set(expandNode, 'display', 'none'); 161 | domClass.replace(iconNode, 'fa-plus-square-o', 'fa-minus-square-o'); 162 | } 163 | })); 164 | }, 165 | //check scales and add/remove disabled classes from checkbox 166 | _checkboxScaleRange: function () { 167 | var node = this.checkNode, 168 | layer = this.layer, 169 | scale = layer.getMap().getScale(), 170 | min = layer.minScale, 171 | max = layer.maxScale; 172 | domClass.remove(node, 'layerControlCheckIconOutScale'); 173 | if ((min !== 0 && scale > min) || (max !== 0 && scale < max)) { 174 | domClass.add(node, 'layerControlCheckIconOutScale'); 175 | } 176 | } 177 | }); 178 | }); -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/templates/Control.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 7 | 10 | 13 | 16 | 17 |
5 | 6 | 8 | 9 | 11 | 12 | 14 | 15 |
18 | 19 |
20 | -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/templates/Folder.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 7 | 10 | 13 | 14 |
5 | 6 | 8 | 9 | 11 | 12 |
15 | 16 |
17 | -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/controls/templates/Sublayer.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 7 | 10 | 13 | 14 |
5 | 6 | 8 | 9 | 11 | 12 |
15 | 16 |
17 | -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/css/LayerControl.css: -------------------------------------------------------------------------------- 1 | .layerControlDijit .vectorLayerContainer { 2 | 3 | } 4 | 5 | .layerControlDijit .vectorLabelContainer { 6 | 7 | } 8 | 9 | .layerControlDijit .overlayLayerContainer { 10 | 11 | } 12 | 13 | .layerControlDijit .overlayLabelContainer { 14 | padding-bottom: 4px; 15 | } 16 | 17 | .layerControlDijit .layerControl { 18 | padding-bottom: 6px; 19 | } 20 | 21 | .layerControlDijit .layerControlExpand { 22 | border-bottom: solid 1px #DDD; 23 | } 24 | 25 | 26 | .layerControlDijit .layerControlTable { 27 | width: 100%; 28 | } 29 | 30 | .layerControlDijit .layerControlTable tr { 31 | vertical-align: middle; 32 | } 33 | 34 | .layerControlDijit .layerControlTable td { 35 | padding: 0; 36 | } 37 | 38 | .layerControlDijit .layerControlTableExpand { 39 | cursor: pointer; 40 | width: 18px; 41 | height: 15px; 42 | line-height: 15px; 43 | } 44 | 45 | .layerControlDijit .layerControlTableCheck { 46 | cursor: pointer; 47 | width: 19px; 48 | height: 16px; 49 | line-height: 16px; 50 | } 51 | 52 | .layerControlDijit .layerControlTableLabel { 53 | font-size: 15px; 54 | height: 16px; 55 | line-height: 16px; 56 | } 57 | 58 | .layerControlDijit .layerControlTableUpdate { 59 | width: 21px; 60 | height: 16px; 61 | line-height: 16px; 62 | text-align: center; 63 | } 64 | 65 | .layerControlDijit .layerControlIndent { 66 | padding-left: 22px; 67 | } 68 | 69 | .layerControlDijit .layerControlIcon { 70 | font-size: 17px; 71 | } 72 | 73 | .layerControlDijit .layerControlUpdateIcon { 74 | font-size: 12px 75 | } 76 | 77 | .layerControlDijit .layerControlCheckIconOutScale { 78 | color: #BBB; 79 | } 80 | 81 | .layerControlDijit .layerControlClick { 82 | cursor: pointer; 83 | color: #1f78af; 84 | text-decoration: none; 85 | -webkit-user-select: none; 86 | -moz-user-select: none; 87 | -ms-user-select: none; 88 | user-select: none; 89 | } 90 | 91 | .layerControlDijit .layerControlClick:hover { 92 | text-decoration: underline; 93 | } 94 | 95 | .layerControlDijit .layerControlLegendTable tr { 96 | vertical-align: middle; 97 | } 98 | 99 | .layerControlDijit .layerControlLegendImage > img { 100 | border: none; 101 | padding: 0; 102 | } 103 | 104 | .layerControlDijit .layerControlLegendLabel { 105 | padding: 0 0 0 4px; 106 | } 107 | 108 | /* temp esri/Legend overrides */ 109 | .layerControlDijit .esriLegendService td { 110 | padding: 0; 111 | } 112 | 113 | .layerControlDijit .esriLegendGroupLayer, .layerControlDijit .esriLegendLayerLabel { 114 | padding: 0; 115 | } 116 | 117 | .layerControlDijit .esriLegendServiceLabel { 118 | display: none; 119 | } 120 | -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/plugins/LayerMenu.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/Menu', 4 | 'dijit/MenuItem', 5 | 'dijit/PopupMenuItem', 6 | 'dijit/MenuSeparator', 7 | './Transparency' 8 | ], function ( 9 | declare, 10 | Menu, 11 | MenuItem, 12 | PopupMenuItem, 13 | MenuSeparator, 14 | Transparency 15 | ) { 16 | return declare(Menu, { 17 | _removed: false, //for future use 18 | postCreate: function () { 19 | this.inherited(arguments); 20 | var control = this.control, 21 | layer = control.layer, 22 | controlOptions = control.controlOptions, 23 | controller = control.controller, 24 | layerType = control._layerType, 25 | menu = this; 26 | //reorder menu items 27 | if ((layerType === 'vector' && controller.vectorReorder) || (layerType === 'overlay' && controller.overlayReorder)) { 28 | control._reorderUp = new MenuItem({ 29 | label: 'Move Up', 30 | onClick: function () { 31 | controller._moveUp(control); 32 | } 33 | }); 34 | menu.addChild(control._reorderUp); 35 | control._reorderDown = new MenuItem({ 36 | label: 'Move Down', 37 | onClick: function () { 38 | controller._moveDown(control); 39 | } 40 | }); 41 | menu.addChild(control._reorderDown); 42 | menu.addChild(new MenuSeparator()); 43 | } 44 | //zoom to layer 45 | if ((controlOptions.noZoom !== true && controller.noZoom !== true) || (controller.noZoom === true && controlOptions.noZoom === false)) { 46 | menu.addChild(new MenuItem({ 47 | label: 'Zoom to Layer', 48 | onClick: function () { 49 | controller._zoomToLayer(layer); 50 | } 51 | })); 52 | } 53 | //transparency 54 | if ((controlOptions.noTransparency !== true && controller.noTransparency !== true) || (controller.noTransparency === true && controlOptions.noTransparency === false)) { 55 | menu.addChild(new Transparency({ 56 | label: 'Transparency', 57 | layer: layer 58 | })); 59 | } 60 | //layer swipe 61 | if (controlOptions.swipe === true || (controller.swipe === true && controlOptions.swipe !== false)) { 62 | var swipeMenu = new Menu(); 63 | swipeMenu.addChild(new MenuItem({ 64 | label: 'Vertical', 65 | onClick: function () { 66 | controller._swipeLayer(layer, 'vertical'); 67 | } 68 | })); 69 | swipeMenu.addChild(new MenuItem({ 70 | label: 'Horizontal', 71 | onClick: function () { 72 | controller._swipeLayer(layer, 'horizontal'); 73 | } 74 | })); 75 | if (controlOptions.swipeScope === true) { 76 | swipeMenu.addChild(new MenuItem({ 77 | label: 'Scope', 78 | onClick: function () { 79 | controller._swipeLayer(layer, 'scope'); 80 | } 81 | })); 82 | } 83 | menu.addChild(new PopupMenuItem({ 84 | label: 'Layer Swipe', 85 | popup: swipeMenu 86 | })); 87 | } 88 | //if last child is a separator remove it 89 | var lastChild = menu.getChildren()[menu.getChildren().length - 1]; 90 | if (lastChild && lastChild.isInstanceOf(MenuSeparator)) { 91 | menu.removeChild(lastChild); 92 | } 93 | } 94 | }); 95 | }); -------------------------------------------------------------------------------- /js/gis/dijit/LayerControl/plugins/Transparency.js: -------------------------------------------------------------------------------- 1 | /* transparency component */ 2 | define([ 3 | 'dojo/_base/declare', 4 | 'dojo/_base/lang', 5 | 'dojo/_base/array', 6 | 'dojo/query', 7 | 'dojo/dom-style', 8 | 'dijit/PopupMenuItem', 9 | 'dijit/TooltipDialog', 10 | 'dijit/form/HorizontalSlider', 11 | 'dijit/form/HorizontalRuleLabels' 12 | ], function ( 13 | declare, 14 | lang, 15 | array, 16 | query, 17 | domStyle, 18 | PopupMenuItem, 19 | TooltipDialog, 20 | HorizontalSlider, 21 | HorizontalRuleLabels 22 | ) { 23 | 'use strict'; 24 | return declare(PopupMenuItem, { 25 | layer: null, 26 | constructor: function (options) { 27 | options = options || {}; 28 | lang.mixin(this, options); 29 | }, 30 | postCreate: function () { 31 | var transparencySlider = new HorizontalSlider({ 32 | value: this.layer.opacity, 33 | minimum: 0, 34 | maximum: 1, 35 | discreteValues: 21, 36 | intermediateChanges: true, 37 | showButtons: false, 38 | onChange: lang.hitch(this, function (value) { 39 | this.layer.setOpacity(value); 40 | array.forEach(query('.' + this.layer.id + '-layerLegendImage'), function (img) { 41 | domStyle.set(img, 'opacity', value); 42 | }); 43 | }) 44 | }); 45 | var rule = new HorizontalRuleLabels({ 46 | labels: ['100%', '50%', '0%'], 47 | style: 'height:1em;font-size:75%;' 48 | }, transparencySlider.bottomDecoration); 49 | rule.startup(); 50 | transparencySlider.startup(); 51 | this.popup = new TooltipDialog({ 52 | style: 'width:200px;', 53 | content: transparencySlider 54 | }); 55 | domStyle.set(this.popup.connectorNode, 'display', 'none'); 56 | this.popup.startup(); 57 | } 58 | }); 59 | }); -------------------------------------------------------------------------------- /js/gis/dijit/LocateButton.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 'esri/dijit/LocateButton', 5 | 'esri/renderers/SimpleRenderer', 6 | 'esri/symbols/PictureMarkerSymbol', 7 | 'esri/layers/GraphicsLayer', 8 | 'esri/InfoTemplate', 9 | 'dojo/topic' 10 | ], function (declare, lang, LocateButton, SimpleRenderer, PictureMarkerSymbol, GraphicsLayer, InfoTemplate, topic) { 11 | return declare(null, { 12 | growlTemplate: 'latitude: {latitude}
longitude: {longitude}
accuracy: {accuracy}
altitude: {altitude}
altitudeAccuracy: {altitudeAccuracy}
heading: {heading}
speed: {speed}', 13 | constructor: function (options, node) { 14 | this.options = options; 15 | this.parentNode = node; 16 | }, 17 | startup: function () { 18 | var symbol = new PictureMarkerSymbol('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABJhJREFUeNrcmN9PW2UYx7/n9ATKj7QMMUCxmSxlCRI3BzF6MRO9WOyVN5sJFxqvNCa7MmbphTG78Iprwx+weEMiF8bdLNFojBhNDEwu3ObWjo2uLUXKaIFSCqdnz7e8hx1WdOcUij+e5ElLOe3zyfd93ud9nlezLAte7LOv0S4vZ8VPi0eU72dx5bPiU+Jr9j8+fevpcTS3YALUIy/viUdRn10TvyK+cChgTwL5dOCZNqA7CARbgIB//+8VSkB+A8jmgdw6YFb2AgrcQt1gAsUli4m3E6gnAAx0A61N3qQqloE7WZGqsAvIZR0TuCnPYAJ1UV4u8H2oAzhZB9B+gLcFML2y+9GkwI27BhOomL10g71AfxcO1eaWgJuZx0srcGNPBbOV4tK9emInjxphzL9f7u4ubY1y+j45VV2+RkLR+NuMoeyCil0LpnZfzF6+RkI54RhLWUwx1CjGktDORD/snPo7YyzGZGzF8BhMkUaZV9x9R22M6duRKGqrpjvUqtapg5aEeowxGdvJoquzr6rWgEe1uJ8rFrSy+EYFOp3v+ZnlEW5gr2rthjqQq8eMF7UYvGRBL5jwFbZhFCs76rfqqAQMbAd8MP0aKroGy61qZFhcrf551lBdQvXs8wK1VoFvoYym+5vwT6ceBrMrq36YW+gOtJRGng/ljzej1NOEcrsO0y0cGRTYacNuW9yWB0agUoSaLpiBianfw5l7ydbBvle0Yi6Dn+IT1s8n+ouj588nR441F55rxmaLBlNzWT6URXbB/qpLqAETtbh8VGrih9nwYHi47e33TyErx3Lhfhc6Zl7Ufrs62TaxfiXc9eEHCS4rl1RzoZqDIaJ73UHbbGkkp64/WAqm/7jROvAacGtTzj5Zgrvii5YJq/N1pH/8tvX6rTtBPrtdx071DGaKYkz0zFLOf/LZF7TMn0BqXlqaJJBZLCOVzwEbq7CWwlpmPunns/yO1zhG3cVHEn0rn8bq3DBK0s4UimsoPlzZaboyImFB1tY06/55z4r5JFdYEno7g6W5+HfW9vwGyullbKSkl7knaiXyVdcqv1q9faESn/W53JUHAqPETOgz/eF8KDJYnPnmC6wncrASotRN6aFnRKnclwi9ca545tRQns8adSoWt3t0N8bdxeLJOjX6zrvJQMfq+vJXFy1c/Rz4fhz68kdW3zn/+ugnl5N8hs9qLhVzMMQNBRZh4+amZDCLuf1ZPEc6/YWuSx8npt+MBrMPUn5UKugOXSqNDL+0W2CrpcJD8+gE49wX5TQTPuZSZlGAFZ3Fk0t1/OWhUnFk6EBHEo0MymYNNYzGOGJxWHB7XjIgKzqDdxrYsksCE91QS+6lRjA2GZRN6dJrc5S6xt6bI5YX0xRgEyFFKTrf6x6haIyt+n8OJ2v2ruSEXC1BJD9qY0zGdrLo6i5hwVbtdvbowW6k96i18GQdI+kah1HOfUdljKVaHabUeE2BVaTVwZPDqGPrNswYwzH4jql8r6386i5hku85jDYSzh54HVcFU//NK4JGX6ow0VVOeb9U+VdfQzX44m7cmej/r6vOf+py+JEAAwDRMD/uB0XQuQAAAABJRU5ErkJggg==', 38, 38); 19 | this.graphics = new GraphicsLayer({ 20 | id: 'GeoLocationGraphics' 21 | }); 22 | var renderer = new SimpleRenderer(symbol); 23 | renderer.label = 'GPS Position'; 24 | renderer.description = 'GPS Position'; 25 | this.graphics.setRenderer(renderer); 26 | this.options.map.addLayer(this.graphics); 27 | this.options.graphicsLayer = this.graphics; 28 | this.options.infoTemplate = new InfoTemplate('GPS Position', '${*}'); 29 | this.options.symbol = null; 30 | 31 | this.locateButton = new LocateButton(this.options, this.parentNode); 32 | this.locateButton.startup(); 33 | this.locateButton.on('locate', lang.hitch(this, '_growlLocation')); 34 | }, 35 | _growlLocation: function (evt) { 36 | var stats = { 37 | accuracy: (evt.position.coords.accuracy) ? evt.position.coords.accuracy : '', 38 | altitude: (evt.position.coords.altitude) ? evt.position.coords.altitude : '', 39 | altitudeAccuracy: (evt.position.coords.altitudeAccuracy) ? evt.position.coords.altitudeAccuracy : '', 40 | heading: (evt.position.coords.heading) ? evt.position.coords.heading : '', 41 | latitude: (evt.position.coords.latitude) ? evt.position.coords.latitude : '', 42 | longitude: (evt.position.coords.longitude) ? evt.position.coords.longitude : '', 43 | speed: (evt.position.coords.speed) ? evt.position.coords.speed : '' 44 | }; 45 | 46 | if (this.graphics.graphics.length > 0) { 47 | this.graphics.graphics[0].attributes = stats; 48 | } 49 | 50 | if (this.options.publishGPSPosition) { 51 | topic.publish('growler/growl', { 52 | title: 'GPS Position', 53 | message: lang.replace(this.growlTemplate, stats), 54 | level: 'default', //can be: 'default', 'warning', 'info', 'error', 'success'. 55 | timeout: 10000, //set to 0 for no timeout 56 | opacity: 1.0 57 | }); 58 | } 59 | } 60 | }); 61 | }); -------------------------------------------------------------------------------- /js/gis/dijit/MapInfo/css/MapInfo.css: -------------------------------------------------------------------------------- 1 | .gis-dijit-MapInfo { 2 | padding: 2px 6px; 3 | overflow: hidden; 4 | background: #F5F5F5; 5 | color: #666; 6 | font-size: 90%; 7 | border-top: solid 1px #DDD; 8 | border-right: solid 1px #DDD; 9 | -webkit-border-radius: 0 4px 0 0; 10 | border-radius: 0 4px 0 0; 11 | } 12 | -------------------------------------------------------------------------------- /js/gis/dijit/Measurement.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dijit/_WidgetBase', 4 | 'esri/dijit/Measurement', 5 | 'dojo/aspect', 6 | 'dojo/_base/lang', 7 | 'dojo/dom-construct', 8 | 'dojo/topic' 9 | ], function (declare, _WidgetBase, Measurement, aspect, lang, domConstruct, topic) { 10 | 11 | return declare([_WidgetBase], { 12 | declaredClass: 'gis.dijit.Measurement', 13 | mapClickMode: null, 14 | postCreate: function () { 15 | this.inherited(arguments); 16 | this.measure = new Measurement({ 17 | map: this.map, 18 | defaultAreaUnit: this.defaultAreaUnit, 19 | defaultLengthUnit: this.defaultLengthUnit 20 | }, domConstruct.create('div')).placeAt(this.domNode); 21 | this.measure.startup(); 22 | aspect.after(this.measure, 'setTool', lang.hitch(this, 'checkMeasureTool')); 23 | aspect.after(this.measure, 'closeTool', lang.hitch(this, 'checkMeasureTool')); 24 | this.own(topic.subscribe('mapClickMode/currentSet', lang.hitch(this, 'setMapClickMode'))); 25 | if (this.parentWidget && this.parentWidget.toggleable) { 26 | this.own(aspect.after(this.parentWidget, 'toggle', lang.hitch(this, function () { 27 | this.onLayoutChange(this.parentWidget.open); 28 | }))); 29 | } 30 | }, 31 | checkMeasureTool: function () { 32 | // no measurement tool is active 33 | if (!this.measure.activeTool || this.measure.activeTool === '') { 34 | if (this.mapClickMode === 'measure') { 35 | this.connectMapClick(); 36 | } 37 | // a measurement tool is active 38 | } else { 39 | if (this.mapClickMode !== 'measure') { 40 | this.disconnectMapClick(); 41 | } 42 | } 43 | }, 44 | disconnectMapClick: function () { 45 | topic.publish('mapClickMode/setCurrent', 'measure'); 46 | }, 47 | connectMapClick: function () { 48 | topic.publish('mapClickMode/setDefault'); 49 | }, 50 | onLayoutChange: function (open) { 51 | // end measurement on close of title pane 52 | if (!open && this.mapClickMode === 'measure') { 53 | this.connectMapClick(); 54 | } 55 | }, 56 | setMapClickMode: function (mode) { 57 | this.mapClickMode = mode; 58 | if (mode !== 'measure') { 59 | this.measure.setTool('area', false); 60 | this.measure.setTool('distance', false); 61 | this.measure.setTool('location', false); 62 | this.measure.clearResult(); 63 | } 64 | } 65 | }); 66 | }); -------------------------------------------------------------------------------- /js/gis/dijit/Print/css/Print.css: -------------------------------------------------------------------------------- 1 | .gis_PrintDijit { 2 | width: 100%; 3 | } 4 | 5 | .gis_PrintDijit .printResult { 6 | /*border: 1px solid #CCCCCC;*/ 7 | height: 28px; 8 | margin-bottom: 3px; 9 | width: 100%; 10 | } 11 | 12 | .gis_PrintDijit .printResult .printResultTable { 13 | width: 100%; 14 | } 15 | 16 | .gis_PrintDijit .printResult .bold { 17 | font-weight: bold; 18 | } 19 | 20 | .gis_PrintDijit .printResultError { 21 | font-weight: bold; 22 | color: red; 23 | } 24 | 25 | .gis_PrintDijit .printResultHover table:hover { 26 | background-color: #D4E7F8; 27 | cursor: pointer; 28 | } 29 | 30 | .gis_PrintDijit .buttonActionBar { 31 | /*background-color: #F2F2F2; 32 | border: 1px solid #CDCDCD;*/ 33 | padding: 3px 0px 2px 0px; 34 | text-align: right; 35 | width: 100%; 36 | } 37 | 38 | .gis_PrintDijit .formContainer { 39 | /*border: 1px solid #bbb;*/ 40 | margin-bottom: -1px; 41 | width: 100%; 42 | } 43 | 44 | .gis_PrintDijit .resultsContainer { 45 | width: 100%; 46 | margin-top: 10px; 47 | margin-bottom: 5px; 48 | } 49 | 50 | .gis_PrintDijit .printIcon { 51 | background-image: url(../images/print.png); 52 | width: 16px; 53 | height: 16px; 54 | } 55 | 56 | .gis_PrintDijit .clearIcon { 57 | background-image: url(../images/clear.png); 58 | width: 16px; 59 | height: 16px; 60 | } 61 | 62 | .gis_PrintDijit .settingsIcon { 63 | background-image: url(../images/settings.png); 64 | width: 16px; 65 | height: 16px; 66 | } -------------------------------------------------------------------------------- /js/gis/dijit/Print/images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Print/images/clear.png -------------------------------------------------------------------------------- /js/gis/dijit/Print/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Print/images/image.png -------------------------------------------------------------------------------- /js/gis/dijit/Print/images/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Print/images/pdf.png -------------------------------------------------------------------------------- /js/gis/dijit/Print/images/print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Print/images/print.png -------------------------------------------------------------------------------- /js/gis/dijit/Print/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/Print/images/settings.png -------------------------------------------------------------------------------- /js/gis/dijit/Print/templates/PrintResult.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 7 | 10 | 14 | 15 |
5 | ${count}. 6 | 8 | 9 | 11 |
12 |
13 |
16 |
17 | -------------------------------------------------------------------------------- /js/gis/dijit/StreetView/css/StreetView.css: -------------------------------------------------------------------------------- 1 | .gis_StreetView { 2 | padding: 5px; 3 | } 4 | 5 | .gis_StreetView .buttonActionBar { 6 | padding: 3px 0px 2px 0px; 7 | text-align: right; 8 | width: 100%; 9 | } 10 | 11 | .gis_StreetView .buttonActionBar .loadingStreetView { 12 | display: none; 13 | width: 18px; 14 | position: relative; 15 | top: 5px; 16 | margin-right: 10px; 17 | background-image: url('../images/loading.gif'); 18 | } 19 | 20 | .gis_StreetView .streetViewNode { 21 | border: 1px solid #999999; 22 | width: 100%; 23 | height: 275px; 24 | } 25 | 26 | .floatingWidget .gis_StreetView .streetViewNode { 27 | width: 400px; 28 | height: 275px; 29 | } 30 | 31 | .gis_StreetView .pegmanIcon { 32 | background-image: url(../images/googleIcon.png); 33 | background-size: contain; 34 | background-repeat: no-repeat; 35 | width: 16px; 36 | height: 20px; 37 | vertical-align: middle; 38 | margin-top: -4px; 39 | margin-bottom: -4px; 40 | } 41 | 42 | .gis_StreetView .noStreetViewResults { 43 | display: none; 44 | background-color: black; 45 | width: 100%; 46 | height: 100%; 47 | z-index: 2; 48 | position: relative; 49 | } 50 | 51 | .gis_StreetView .noStreetViewResultsText { 52 | color: white; 53 | background-color: black; 54 | z-index: 2; 55 | position: relative; 56 | top: 40%; 57 | text-align: center; 58 | font-size: 12pt; 59 | padding: 10px; 60 | } -------------------------------------------------------------------------------- /js/gis/dijit/StreetView/images/blueArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/StreetView/images/blueArrow.png -------------------------------------------------------------------------------- /js/gis/dijit/StreetView/images/googleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/StreetView/images/googleIcon.png -------------------------------------------------------------------------------- /js/gis/dijit/StreetView/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/StreetView/images/loading.gif -------------------------------------------------------------------------------- /js/gis/dijit/StreetView/images/svicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/StreetView/images/svicon.png -------------------------------------------------------------------------------- /js/gis/dijit/StreetView/templates/StreetView.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | StreetView not available at this location. 6 |
7 |
8 |
9 |
10 | 11 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /js/gis/dijit/TOC/css/TOC.css: -------------------------------------------------------------------------------- 1 | .agsjsTOCNode { 2 | padding-top: 1px; 3 | padding-bottom: 1px; 4 | } 5 | 6 | .agsjsTOCContent { 7 | white-space: nowrap; 8 | } 9 | 10 | .agsjsTOCOutOfScale { 11 | color: grey; 12 | opacity: 0.5; 13 | } 14 | 15 | .agsjsTOCIcon { 16 | vertical-align:bottom 17 | } 18 | 19 | .agsjsTOCRootLayer { 20 | } 21 | 22 | .agsjsTOCRootLayerLabel { 23 | font-size: 11pt; 24 | font-weight: bold; 25 | } 26 | 27 | .agsjsTOCGroupLayer { 28 | font-weight: bold; 29 | } 30 | 31 | .agsjsTOCGroupLayerLabel { 32 | font-size: 10pt; 33 | } 34 | 35 | .agsjsTOCServiceLayer { 36 | font-weight: bold; 37 | } 38 | 39 | .agsjsTOCServiceLayerLabel { 40 | font-size: 10pt; 41 | padding-left: 2px; 42 | } 43 | 44 | .agsjsTOCLegendIcon { 45 | /* width: 50px;*/ 46 | } 47 | 48 | .agsjsTOCLegendLabel { 49 | font-size: 8pt; 50 | padding-left: 2px; 51 | } 52 | 53 | .agsjsTOCSlider { 54 | padding: 5px 20px 5px 30px; 55 | } 56 | 57 | .agsjsTOCNode .dijitTreeExpando { 58 | background-image: url('../images/treeExpandImages.png'); 59 | width: 15px; 60 | height: 15px; 61 | background-position: -15px 0px; 62 | background-size: 30px 15px; 63 | vertical-align: top; 64 | margin: 3px 3px 2px 2px; 65 | } 66 | 67 | .agsjsTOCNode .dijitTreeExpandoClosed { 68 | background-position: -0px 0px; 69 | } 70 | -------------------------------------------------------------------------------- /js/gis/dijit/TOC/images/treeExpandImages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/gis/dijit/TOC/images/treeExpandImages.png -------------------------------------------------------------------------------- /js/gis/dijit/TOC/templates/tocNode.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /js/gis/dijit/Vim.js: -------------------------------------------------------------------------------- 1 | // Vim.js 2 | // Used to serialize/deserialize the identitymanager storing 3 | // credential objects (tokens) in either local storage or a cookie 4 | // usage: 5 | // param 1: the name of the cookie/localstorage key 6 | // new Vim(idStateName); 7 | 8 | define([ 9 | 'dojo/_base/declare', 10 | 'esri/kernel', 11 | 'dojo/cookie', 12 | 'dojo/json', 13 | 'dojo/_base/unload', 14 | 'dojo/_base/lang' 15 | ], function(declare, kernel, cookie, JSON, baseUnload, lang) { 16 | return declare(null, { 17 | constructor: function(idStateName) { 18 | this.idStateName = idStateName || 'esri_jsapi_id_manager_data'; 19 | baseUnload.addOnUnload(lang.hitch(this, 'storeCredentials')); 20 | this.loadCredentials(); 21 | }, 22 | loadCredentials: function() { 23 | var idJson, idObject; 24 | if (this._supportsLocalStorage()) { 25 | idJson = window.localStorage.getItem(this.idStateName); 26 | } else { 27 | idJson = cookie(this.idStateName); 28 | } 29 | if (idJson && idJson != 'null' && idJson.length > 4) { 30 | idObject = JSON.parse(idJson); 31 | kernel.id.initialize(idObject); 32 | } 33 | }, 34 | storeCredentials: function() { 35 | if (kernel.id.credentials.length === 0) { 36 | return; 37 | } 38 | var idString = JSON.stringify(kernel.id.toJson()); 39 | if (this._supportsLocalStorage()) { 40 | window.localStorage.setItem(this.idStateName, idString); 41 | } else { 42 | cookie(this.idStateName, idString, { 43 | expires: 1 44 | }); 45 | } 46 | }, 47 | _supportsLocalStorage: function() { 48 | try { 49 | return 'localStorage' in window && window.localStorage !== null; 50 | } catch (e) { 51 | return false; 52 | } 53 | } 54 | }); 55 | }); 56 | -------------------------------------------------------------------------------- /js/gis/dijit/_FloatingWidgetMixin.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/on', 4 | 'dojo/_base/lang' 5 | ], function (declare, on, lang) { 6 | return declare(null, { 7 | startup: function () { 8 | // var parentWidget = this.getParent(); 9 | if (this.parentWidget && this.parentWidget.declaredClass === 'gis.dijit.FloatingWidget' && this.onOpen) { 10 | on(this.parentWidget, 'show', lang.hitch(this, 'onOpen')); 11 | } 12 | if (this.parentWidget && this.parentWidget.declaredClass === 'gis.dijit.FloatingWidget' && this.onClose) { 13 | on(this.parentWidget, 'hide', lang.hitch(this, 'onClose')); 14 | } 15 | if (this.parentWidget && this.parentWidget.declaredClass === 'gis.dijit.FloatingWidget' && this.openOnStartup) { 16 | this.parentWidget.show(); 17 | } 18 | 19 | this.inherited(arguments); 20 | } 21 | }); 22 | }); -------------------------------------------------------------------------------- /js/gis/plugins/async.js: -------------------------------------------------------------------------------- 1 | /*global dojoConfig */ 2 | /*jshint unused:true */ 3 | define(function () { 4 | var cb = '_asyncApiLoaderCallback'; 5 | return { 6 | load: function (param, req, loadCallback) { 7 | if (!cb) { 8 | return; 9 | } else { 10 | dojoConfig[cb] = function () { 11 | delete dojoConfig[cb]; 12 | cb = null; 13 | loadCallback(); 14 | }; 15 | require([param + '&callback=dojoConfig.' + cb]); 16 | } 17 | } 18 | }; 19 | }); -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/css/DnD.css: -------------------------------------------------------------------------------- 1 | .esri-DnD { 2 | position: relative; 3 | } 4 | 5 | .esri-DnD .instructions { 6 | border: 1px dashed #666; 7 | padding: 5px; 8 | margin: 2px; 9 | } 10 | 11 | .esri-DnD-target { 12 | background-color: rgba(0,0,0,.25); 13 | position: absolute; 14 | top: 0; 15 | width: 100%; 16 | z-index: 1000; 17 | } 18 | 19 | .esri-DnD .alert-info { 20 | background-color: #fcf8e3; 21 | color: #c09853; 22 | border: 1px dashed #c09853; 23 | padding: 5px; 24 | } 25 | 26 | .esri-DnD .off { 27 | display: none; 28 | } 29 | 30 | .esri-DnD .manualResourceAdd { 31 | color:#333; 32 | padding:.1em .1em .1em .3em; 33 | background:#f7f7f7; 34 | border:1px solid #ccc; 35 | margin: 2px; 36 | } 37 | 38 | .esri-DnD .manualResourceAdd .fileInput { 39 | background: white; 40 | box-shadow: inset 0 0 0 1px #cfcfcf; 41 | } 42 | 43 | .esri-DnD .manualResourceAdd .serviceUrlInput { 44 | border: 1px solid #cfcfcf; 45 | height: 18px; 46 | } -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/css/DroppedItem.css: -------------------------------------------------------------------------------- 1 | .esri-DroppedItem { 2 | border: 1px solid #666666; 3 | margin: 2px; 4 | padding: 4px; 5 | } 6 | 7 | .esri-DroppedItem .iconNode { 8 | width: 32px; 9 | height: 32px; 10 | display: inline-block; 11 | float: left; 12 | } 13 | 14 | .esri-DroppedItem .labelNode { 15 | display: inline-block; 16 | line-height: 32px; 17 | float: left; 18 | overflow-x: hidden; 19 | text-overflow: ellipsis; 20 | } 21 | 22 | .esri-DroppedItem .removeNode { 23 | display: inline-block; 24 | float: right; 25 | cursor: pointer; 26 | } 27 | 28 | .esri-DroppedItem .labelNode .sub-label { 29 | font-size: 80%; 30 | color: #777; 31 | } 32 | 33 | .esri-DroppedItem .containerNode { 34 | padding-left: 35px; 35 | max-height: 250px; 36 | overflow-y: auto; 37 | overflow-x: hidden; 38 | } 39 | 40 | .esri-DroppedItem .clearer { 41 | clear: both; 42 | } 43 | 44 | .esri-DroppedItem .layerTitle { 45 | font-style: oblique; 46 | } 47 | 48 | .esri-DroppedItem .layerInfo { 49 | padding-left: 5px; 50 | } 51 | -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/database.png -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/earth.png -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/folder.png -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/images.png -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/loading.gif -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/map.png -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/remove.png -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/DnD/DnD/images/warning.png -------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/templates/DnD.html: -------------------------------------------------------------------------------- 1 |
2 |
Drag-and-drop KML files, CSV files, shapefiles, or service urls here or onto the map
3 |
4 | The browser you are using does not support drag-and-drop functionality. Try newer versions of Chrome or Firefox if possible. 5 |
6 |
7 |
8 | 9 | or Service url 10 | 11 | 12 |
13 |
-------------------------------------------------------------------------------- /js/viewer/dijit/DnD/DnD/templates/DroppedItem.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
${label}
4 |
5 | 6 |
7 |
8 |
-------------------------------------------------------------------------------- /js/viewer/dijit/Goto/Goto/css/Goto.css: -------------------------------------------------------------------------------- 1 | .gis_GotoDijit .coordinateHint { 2 | font-size: 80%; 3 | font-style: italic; 4 | color: #aaa; 5 | } 6 | 7 | .gis_GotoDijit .questionIcon { 8 | background-image: url('../images/iconsprite.png'); 9 | background-position: -14px 0; 10 | background-size: 25px 10px; 11 | width: 10px; 12 | height: 10px; 13 | display: inline-block; 14 | margin: 0 2px; 15 | cursor: pointer; 16 | } -------------------------------------------------------------------------------- /js/viewer/dijit/Goto/Goto/images/iconsprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/Goto/Goto/images/iconsprite.png -------------------------------------------------------------------------------- /js/viewer/dijit/Goto/Goto/templates/Goto.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 8 |
9 |
10 | 11 | 12 |
13 |
14 | Longitude/Latitude -100.1234 30.1234 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /js/viewer/dijit/MapNavigationHash/MapNavigationHash.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'dojo/_base/declare', 3 | 'dojo/_base/lang', 4 | 5 | 'dojo/router', 6 | 'dojo/hash', 7 | 'dojo/on', 8 | 9 | 'esri/geometry/webMercatorUtils', 10 | 11 | 'dijit/_WidgetBase' 12 | ], function( 13 | declare, lang, 14 | router, hash, on, 15 | webMercatorUtils, 16 | _WidgetBase 17 | ) { 18 | return declare([_WidgetBase], { 19 | 20 | postCreate: function() { 21 | this.inherited(arguments); 22 | 23 | router.register('/:longitude/:latitude/:zoomLevel', lang.hitch(this, 'handleHashChange')); 24 | router.startup(); 25 | if (hash() === '') { 26 | router.go('/'); 27 | } 28 | this.own(on(this.map, 'extent-change', lang.hitch(this, 'updateLocationHash'))); 29 | }, 30 | 31 | handleHashChange: function(evt) { 32 | this.changeLocation(evt); 33 | }, 34 | changeLocation: function(evt) { 35 | if (!this.hashUpdating) { 36 | this.mapUpdating = true; 37 | var zoom = evt.params.zoomLevel || this.map.getLevel(); 38 | this.map.centerAndZoom([evt.params.longitude, evt.params.latitude], zoom).then(lang.hitch(this, function() { 39 | this.mapUpdating = false; 40 | })); 41 | } 42 | }, 43 | updateLocationHash: function(evt) { 44 | if (!this.mapUpdating) { 45 | this.hashUpdating = true; 46 | var x = (evt.extent.xmax + evt.extent.xmin) / 2, 47 | y = (evt.extent.ymax + evt.extent.ymin) / 2; 48 | var geographicLocation = webMercatorUtils.xyToLngLat(x, y); 49 | var currentHash = hash().split('/'); 50 | currentHash[1] = geographicLocation[0].toFixed(4); 51 | currentHash[2] = geographicLocation[1].toFixed(4); 52 | currentHash[3] = this.map.getLevel(); 53 | hash(currentHash.join('/')); 54 | this.hashUpdating = false; 55 | } 56 | } 57 | }); 58 | }); -------------------------------------------------------------------------------- /js/viewer/dijit/Nearby/Nearby/css/Nearby.css: -------------------------------------------------------------------------------- 1 | .gis_NearbyDijit .off { 2 | display: none; 3 | } 4 | 5 | .gis_NearbyDijit .padTop { 6 | margin-top: 5px; 7 | } 8 | 9 | .gis_NearbyDijit .padLeft { 10 | margin-left: 15px; 11 | } 12 | 13 | .gis_NearbyDijit .dijitButton { 14 | margin-left: 0; 15 | } 16 | 17 | .gis_NearbyDijit .nearbyValueInput { 18 | width: 30px; 19 | } 20 | 21 | .gis_NearbyDijit .resultsContainer { 22 | font-weight: bold; 23 | margin: 10px; 24 | } 25 | 26 | .gis_NearbyDijit .loading { 27 | display: inline-block; 28 | height: 20px; 29 | width: 20px; 30 | } 31 | 32 | .resultsGrid { 33 | position: relative; 34 | } 35 | 36 | .nearbyNonModal { 37 | width: 600px; 38 | } 39 | 40 | .nearbyNonModal .dockButton { 41 | display: inline-block; 42 | height: 15px; 43 | width: 15px; 44 | background-image: url('../images/dock.png'); 45 | background-size: 100%; 46 | cursor: pointer; 47 | float: right; 48 | margin-top: 7px; 49 | margin-right: 7px; 50 | } 51 | 52 | .resultsGrid .undockButton { 53 | display: inline-block; 54 | height: 15px; 55 | width: 15px; 56 | background-image: url('../images/undock.png'); 57 | background-size: 100%; 58 | cursor: pointer; 59 | margin-top: 7px; 60 | position: absolute; 61 | top: 0; 62 | right: 0; 63 | z-index: 1000; 64 | } 65 | 66 | .resultsGrid .dgrid { 67 | height: 240px; 68 | width:100%; 69 | overflow: auto; 70 | } 71 | .nearbyNonModal .dgrid { 72 | height: 335px; 73 | width:100%; 74 | overflow: auto; 75 | } 76 | 77 | .resultsGrid .dgrid .dgrid-scroller, 78 | .nearbyNonModal .dgrid .dgrid-scroller { 79 | margin-top: 56px !important; 80 | } 81 | 82 | .resultsGrid .dgrid .dgrid-header th, 83 | .nearbyNonModal .dgrid .dgrid-header th { 84 | font-weight: bold; 85 | } 86 | 87 | .resultsGrid .dgrid .dgrid-cell, 88 | .nearbyNonModal .dgrid .dgrid-cell { 89 | font-size: 11px; 90 | padding: 8px; 91 | cursor: pointer; 92 | width: 88px; 93 | } 94 | 95 | .resultsGrid .dgrid .dgrid-column-Descrip, 96 | .resultsGrid .dgrid .dgrid-column-NewsLink, 97 | .nearbyNonModal .dgrid .dgrid-column-Descrip, 98 | .nearbyNonModal .dgrid .dgrid-column-NewsLink { 99 | width: 300px; 100 | } 101 | 102 | .resultsGrid .dgrid .dgrid-row, 103 | .nearbyNonModal .dgrid .dgrid-row { 104 | border: none; 105 | } 106 | 107 | .resultsGrid .dgrid .dgrid-cell, 108 | .nearbyNonModal .dgrid .dgrid-cell { 109 | border-color: #ddd; 110 | border-style: solid; 111 | border-width: 0 1px 1px 0; 112 | } 113 | 114 | .resultsGrid .dgrid .dgrid-row-odd .dgrid-cell, 115 | .nearbyNonModal .dgrid .dgrid-row-odd .dgrid-cell { 116 | background-color: #eee; 117 | } 118 | 119 | .resultsGrid .dgrid .dgrid-selected .dgrid-cell, 120 | .nearbyNonModal .dgrid .dgrid-selected .dgrid-cell { 121 | background-color: #049cdb; 122 | } 123 | 124 | .nearbyNonModal_underlay { 125 | display: none; 126 | } -------------------------------------------------------------------------------- /js/viewer/dijit/Nearby/Nearby/images/crosshairs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/Nearby/Nearby/images/crosshairs.png -------------------------------------------------------------------------------- /js/viewer/dijit/Nearby/Nearby/images/dock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/Nearby/Nearby/images/dock.png -------------------------------------------------------------------------------- /js/viewer/dijit/Nearby/Nearby/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/Nearby/Nearby/images/loading.gif -------------------------------------------------------------------------------- /js/viewer/dijit/Nearby/Nearby/images/undock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/dijit/Nearby/Nearby/images/undock.png -------------------------------------------------------------------------------- /js/viewer/dijit/Nearby/Nearby/templates/Nearby.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
Set nearby area:
4 |
5 | 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 17 | 18 | 19 |
20 |
Summarize features from:
21 |
22 | 23 |
24 |
25 | 26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |
-------------------------------------------------------------------------------- /js/viewer/templates/leftContent.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrianBunker/cmv-widgets/860824da1be23b2d3c88613fe6e443fe0bdc2207/js/viewer/templates/leftContent.html -------------------------------------------------------------------------------- /js/viewer/templates/mapOverlay.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
-------------------------------------------------------------------------------- /proxy/PROXY_README.md: -------------------------------------------------------------------------------- 1 | DotNet Proxy File 2 | ================= 3 | 4 | A .NET proxy that handles support for 5 | * Accessing cross domain resources 6 | * Requests that exceed 2048 characters 7 | * Accessing resources secured with token based authentication. 8 | * [OAuth 2.0 app logins](https://developers.arcgis.com/en/authentication). 9 | * Enabling logging 10 | * Both resource and referer based rate limiting 11 | 12 | ##Instructions 13 | 14 | * Download and unzip the .zip file or clone the repository. You can download [a released version](https://github.com/Esri/resource-proxy/releases) (recommended) or the [most recent daily build](https://github.com/Esri/resource-proxy/archive/master.zip). 15 | * Install the contents of the DotNet folder as a .NET Web Application, specifying a .NET 4.0 application pool or later 16 | * Test that the proxy is able to forward requests directly in the browser using: 17 | ``` 18 | http://[yourmachine]/DotNet/proxy.ashx?http://services.arcgisonline.com/ArcGIS/rest/services/?f=pjson 19 | ``` 20 | * Edit the proxy.config file in a text editor to set up your proxy configuration settings. 21 | * Update your application to use the proxy for the specified services. In this JavaScript example requests to route.arcgis.com will utilize the proxy. 22 | 23 | ``` 24 | urlUtils.addProxyRule({ 25 | urlPrefix: "route.arcgis.com", 26 | proxyUrl: "http://[yourmachine]/proxy/proxy.ashx" 27 | }); 28 | ``` 29 | * Security tip: By default, the proxy.config allows any referrer. To lock this down, replace the ```*``` in the ```allowedReferers``` property with your own application URLs. 30 | 31 | ##Proxy Configuration Settings 32 | 33 | * Use the ProxyConfig tag to specify the following proxy level settings. 34 | * **mustMatch="true"** : When true only the sites listed using serverUrl will be proxied. Set to false to proxy any site, which can be useful in testing. However, we recommend setting it to "true" for production sites. 35 | * **allowedReferers="http://server.com/app1,http://server.com/app2"** : A comma-separated list of referer URLs. Only requests coming from referers in the list will be proxied. 36 | * Add a new \ entry for each service that will use the proxy. The proxy.config allows you to use the serverUrl tag to specify one or more ArcGIS Server services that the proxy will forward requests to. The serverUrl tag has the following attributes: 37 | * **url**: Location of the ArcGIS Server service (or other URL) to proxy. Specify either the specific URL or the root (in which case you should set matchAll="false"). 38 | * **matchAll="true"**: When true all requests that begin with the specified URL are forwarded. Otherwise, the URL requested must match exactly. 39 | * **username**: Username to use when requesting a token - if needed for ArcGIS Server token based authentication. 40 | * **password**: Password to use when requesting a token - if needed for ArcGIS Server token based authentication. 41 | * **clientId**. Used with clientSecret for OAuth authentication to obtain a token - if needed for OAuth 2.0 authentication. **NOTE**: If used to access hosted services, the service(s) must be owned by the user accessing it, (with the exception of credit-based esri services, e.g. routing, geoenrichment, etc.) 42 | * **clientSecret**: Used with clientId for OAuth authentication to obtain a token - if needed for OAuth 2.0 authentication. 43 | * **oauth2Endpoint**: When using OAuth 2.0 authentication specify the portal specific OAuth 2.0 authentication endpoint. The default value is https://www.arcgis.com/sharing/oauth2/. 44 | * **accessToken**: OAuth2 access token to use instead of on-demand access-token generation using clientId & clientSecret. 45 | * **rateLimit**: The maximum number of requests with a particular referer over the specified **rateLimitPeriod**. 46 | * **rateLimitPeriod**: The time period (in minutes) within which the specified number of requests (rate_limit) sent with a particular referer will be tracked. The default value is 60 (one hour). 47 | 48 | Note: Refresh the proxy application after updates to the proxy.config have been made. 49 | 50 | Example of proxy using application credentials and limiting requests to 10/minute 51 | ``` 52 | 58 | 59 | ``` 60 | Example of a tag for a resource which does not require authentication 61 | ``` 62 | 64 | 65 | ``` 66 | Note: You may have to refresh the proxy application after updates to the proxy.config have been made. 67 | 68 | ##Folders and Files 69 | 70 | The proxy consists of the following files: 71 | * proxy.config: This file contains the configuration settings for the proxy. This is where you will define all the resources that will use the proxy. After updating this file you might need to refresh the proxy application using IIS tools in order for the changes to take effect. 72 | * **Important note:** In order to keep your credentials safe, ensure that your web server will not display the text inside your proxy.config in the browser (ie: http://[yourmachine]/proxy/proxy.config). 73 | * proxy.ashx: The actual proxy application. In most cases you will not need to modify this file. 74 | * web.config: An XML file that stores ASP.NET configuration data. Use this file to configure logging for the proxy. By default the proxy will write log messages to a file named auth_proxy.log located in 'C:\Temp\Shared\proxy_logs'. Note that the folder location needs to exist in order for the log file to be successfully created. 75 | ##Requirements 76 | 77 | * ASP.NET 4.0 or greater (4.5 is required on Windows 8/Server 2012, see [this article] (http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45) for more information) 78 | 79 | ##Issues 80 | 81 | Found a bug or want to request a new feature? Let us know by submitting an issue. 82 | 83 | ##Contributing 84 | 85 | All contributions are welcome. 86 | 87 | ##Licensing 88 | 89 | Copyright 2014 Esri 90 | 91 | Licensed under the Apache License, Version 2.0 (the "License"); 92 | You may not use this file except in compliance with the License. 93 | You may obtain a copy of the License at 94 | http://www.apache.org/licenses/LICENSE-2.0 95 | 96 | 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 specific language governing permissions and limitations under the license. 97 | -------------------------------------------------------------------------------- /proxy/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /proxy/proxy.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /proxy/proxy.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /proxy/readme.md: -------------------------------------------------------------------------------- 1 | # AGS Proxy page help 2 | 3 | For full info please read here: 4 | [https://developers.arcgis.com/javascript/jshelp/ags_proxy.html](https://developers.arcgis.com/javascript/jshelp/ags_proxy.html) 5 | 6 | You will more than likely need a proxy page for printing and other large cross domain requests. 7 | There are diffrent flavors (.net, jsp, php) of the proxy page depending on your server side technology. See the above link for full details. --------------------------------------------------------------------------------