From b189f5c80ae347fa7fa6ecebd24a347c7bf40a5e Mon Sep 17 00:00:00 2001 From: Tim McGee Date: Fri, 8 Jul 2016 12:13:06 -0700 Subject: [PATCH 1/4] fixed typo. --- viewer/js/gis/dijit/LayerControl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viewer/js/gis/dijit/LayerControl.js b/viewer/js/gis/dijit/LayerControl.js index c1158b1f0..4dbf4b07f 100644 --- a/viewer/js/gis/dijit/LayerControl.js +++ b/viewer/js/gis/dijit/LayerControl.js @@ -206,7 +206,7 @@ define([ if (layer.loaded) { this._applyLayerControlOptions(layerInfo.controlOptions, layer); } else { - layer.on('load', lang.hitch(this, '_applyLayerControlOptions', layer.controlOptions)); + layer.on('load', lang.hitch(this, '_applyLayerControlOptions', layerInfo.controlOptions)); } } var layerControl = new Control({ From a3f09e355314f509f385625915b380799f71e9ae Mon Sep 17 00:00:00 2001 From: Tim McGee Date: Fri, 8 Jul 2016 12:15:29 -0700 Subject: [PATCH 2/4] ensure that `_reorderUp` and `_reoderDown` dom nodes exist before calling set methods. --- viewer/js/gis/dijit/LayerControl.js | 40 +++++++++++++++++------------ 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/viewer/js/gis/dijit/LayerControl.js b/viewer/js/gis/dijit/LayerControl.js index 4dbf4b07f..bffc5b586 100644 --- a/viewer/js/gis/dijit/LayerControl.js +++ b/viewer/js/gis/dijit/LayerControl.js @@ -346,29 +346,37 @@ define([ if (this.separated) { if (this.vectorReorder) { array.forEach(this._vectorContainer.getChildren(), function (child) { - if (!child.getPreviousSibling()) { - child._reorderUp.set('disabled', true); - } else { - child._reorderUp.set('disabled', false); + if (child._reorderUp) { + if (!child.getPreviousSibling()) { + child._reorderUp.set('disabled', true); + } else { + child._reorderUp.set('disabled', false); + } } - if (!child.getNextSibling()) { - child._reorderDown.set('disabled', true); - } else { - child._reorderDown.set('disabled', false); + if (child._reorderDown) { + if (!child.getNextSibling()) { + child._reorderDown.set('disabled', true); + } else { + child._reorderDown.set('disabled', false); + } } }, this); } if (this.overlayReorder) { array.forEach(this._overlayContainer.getChildren(), function (child) { - if (!child.getPreviousSibling()) { - child._reorderUp.set('disabled', true); - } else { - child._reorderUp.set('disabled', false); + if (child._reorderUp) { + if (!child.getPreviousSibling()) { + child._reorderUp.set('disabled', true); + } else { + child._reorderUp.set('disabled', false); + } } - if (!child.getNextSibling()) { - child._reorderDown.set('disabled', true); - } else { - child._reorderDown.set('disabled', false); + if (child._reorderDown) { + if (!child.getNextSibling()) { + child._reorderDown.set('disabled', true); + } else { + child._reorderDown.set('disabled', false); + } } }, this); } From c4e3958e7295029b57fad7d5dc6ffb668cf0ded2 Mon Sep 17 00:00:00 2001 From: Tim McGee Date: Wed, 13 Jul 2016 13:38:21 -0700 Subject: [PATCH 3/4] use HTTPS whereever possible because it is the right thing to do. --- README.md | 2 +- viewer/css/main.css | 2 +- viewer/index.html | 8 ++++---- viewer/js/config/basemaps.js | 8 ++++---- viewer/js/config/find.js | 4 ++-- viewer/js/config/viewer.js | 20 +++++++++---------- viewer/js/gis/dijit/Find/nls/resource.js | 2 +- .../js/gis/dijit/LayerControl/nls/resource.js | 2 +- .../dijit/LayerControl/plugins/legendUtil.js | 2 +- viewer/js/gis/dijit/Print/nls/resource.js | 2 +- .../js/gis/dijit/StreetView/nls/resource.js | 2 +- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 3244f9377..50c57c03e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Read The Docs](https://img.shields.io/badge/docs-1.3.4-brightgreen.svg?style=flat)](http://docs.cmv.io/) [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/cmv/cmv-app?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](http://travis-ci.org/cmv/cmv-app.svg?branch=master)](http://travis-ci.org/cmv/cmv-app) ## Introduction -[CMV](http://cmv.io/) is a community-supported open source mapping framework. CMV works with the [Esri JavaScript API](http://docs.cmv.io/en/latest/developers.arcgis.com/javascript/jsapi/), [ArcGIS Server](http://www.esri.com/software/arcgis/arcgisserver), [ArcGIS Online](https://arcgis.com/) and more. +[CMV](http://cmv.io/) is a community-supported open source mapping framework. CMV works with the [Esri JavaScript API](http://developers.arcgis.com/javascript/jsapi/3/), [ArcGIS Server](https://www.esri.com/software/arcgis/arcgisserver), [ArcGIS Online](https://arcgis.com/) and more. ## Make It Your Own! This JavaScript web app can be easily configured or used as a boilerplate/starting point for basic viewers. It also demonstrates best practices for modular design and OOP via classes in JS using dojo's great [declare](http://dojotoolkit.org/reference-guide/1.9/dojo/_base/declare.html) system. diff --git a/viewer/css/main.css b/viewer/css/main.css index a88b52722..f351cc5be 100644 --- a/viewer/css/main.css +++ b/viewer/css/main.css @@ -312,7 +312,7 @@ body, html { /* media queries bootstrap style - http://getbootstrap.com/css/#grid-media-queries + https://getbootstrap.com/css/#grid-media-queries */ @media screen and (max-width: 991px) { diff --git a/viewer/index.html b/viewer/index.html index a5c4b41d5..8edd538da 100644 --- a/viewer/index.html +++ b/viewer/index.html @@ -11,8 +11,8 @@ Configurable Map Viewer - - + + @@ -39,9 +39,9 @@ - + diff --git a/viewer/js/config/basemaps.js b/viewer/js/config/basemaps.js index 2949e10a0..92e4ba169 100644 --- a/viewer/js/config/basemaps.js +++ b/viewer/js/config/basemaps.js @@ -86,7 +86,7 @@ define([ basemap: { baseMapLayers: [ { - url: 'http://tiles.arcgis.com/tiles/IEuSomXfi6iB7a25/arcgis/rest/services/World_Globe_1812/MapServer' + url: 'https://tiles.arcgis.com/tiles/IEuSomXfi6iB7a25/arcgis/rest/services/World_Globe_1812/MapServer' } ] } @@ -252,7 +252,7 @@ define([ basemap: new Basemap({ id: 'stamenToner', layers: [new BasemapLayer({ - url: 'http://tile.stamen.com/toner/${level}/${col}/${row}.png', + url: 'https://tile.stamen.com/toner/${level}/${col}/${row}.png', copyright: 'stamen, 2016', id: 'stamenToner', type: 'WebTiledLayer' @@ -264,7 +264,7 @@ define([ basemap: new Basemap({ id: 'stamenTerrain', layers: [new BasemapLayer({ - url: 'http://tile.stamen.com/terrain/${level}/${col}/${row}.png', + url: 'https://tile.stamen.com/terrain/${level}/${col}/${row}.png', copyright: 'stamen, 2016', id: 'stamenTerrain', type: 'WebTiledLayer' @@ -276,7 +276,7 @@ define([ basemap: new Basemap({ id: 'stamenWatercolor', layers: [new BasemapLayer({ - url: 'http://tile.stamen.com/watercolor/${level}/${col}/${row}.png', + url: 'https://tile.stamen.com/watercolor/${level}/${col}/${row}.png', copyright: 'stamen, 2016', id: 'stamenWatercolor', type: 'WebTiledLayer' diff --git a/viewer/js/config/find.js b/viewer/js/config/find.js index 5e9cb84c7..aa323416a 100644 --- a/viewer/js/config/find.js +++ b/viewer/js/config/find.js @@ -5,7 +5,7 @@ define({ queries: [ { description: 'Find A Public Safety Location By Name', - url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', + url: 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', layerIds: [1, 2, 3, 4, 5, 6, 7], searchFields: ['FDNAME, PDNAME', 'NAME', 'RESNAME'], minChars: 2, @@ -33,7 +33,7 @@ define({ }, { description: 'Find Incident By Code/Description', - url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', + url: 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', layerIds: [15, 17, 18], searchFields: ['FCODE', 'DESCRIPTION'], minChars: 4, diff --git a/viewer/js/config/viewer.js b/viewer/js/config/viewer.js index 39b0194b2..89d2eb3ac 100644 --- a/viewer/js/config/viewer.js +++ b/viewer/js/config/viewer.js @@ -19,7 +19,7 @@ define([ });*/ // url to your geometry server. - esriConfig.defaults.geometryService = new GeometryService('http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer'); + esriConfig.defaults.geometryService = new GeometryService('https://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer'); // helper function returning ImageParameters for dynamic layers // example: @@ -110,7 +110,7 @@ define([ // 3 'mode' options: MODE_SNAPSHOT = 0, MODE_ONDEMAND = 1, MODE_SELECTION = 2 operationalLayers: [{ type: 'feature', - url: 'http://services1.arcgis.com/6bXbLtkf4y11TosO/arcgis/rest/services/Restaurants/FeatureServer/0', + url: 'https://services1.arcgis.com/6bXbLtkf4y11TosO/arcgis/rest/services/Restaurants/FeatureServer/0', title: 'Restaurants', options: { id: 'restaurants', @@ -130,7 +130,7 @@ define([ } }, { type: 'feature', - url: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0', + url: 'https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0', title: 'San Francisco 311 Incidents', options: { id: 'sf311Incidents', @@ -141,7 +141,7 @@ define([ } }, { type: 'dynamic', - url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', + url: 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', title: 'Louisville Public Safety', options: { id: 'louisvillePubSafety', @@ -165,7 +165,7 @@ define([ } }, { type: 'dynamic', - url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer', + url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer', title: 'Damage Assessment', options: { id: 'DamageAssessment', @@ -186,7 +186,7 @@ define([ }, { type: 'vectortile', title: 'Light Gray Canvas Vector', - url: '//www.arcgis.com/sharing/rest/content/items/bdf1eec3fa79456c8c7c2bb62f86dade/resources/styles/root.json', + url: 'https://www.arcgis.com/sharing/rest/content/items/bdf1eec3fa79456c8c7c2bb62f86dade/resources/styles/root.json', options: { id: 'vectortile1', opacity: 0.8, @@ -200,12 +200,12 @@ define([ id: 'vectortile2', opacity: 1.0, visible: true, - 'glyphs': '//www.arcgis.com/sharing/rest/content/items/00cd8e843bae49b3a040423e5d65416b/resources/fonts/{fontstack}/{range}.pbf', - 'sprite': '//www.arcgis.com/sharing/rest/content/items/00cd8e843bae49b3a040423e5d65416b/resources/sprites/sprite', + 'glyphs': 'https://www.arcgis.com/sharing/rest/content/items/00cd8e843bae49b3a040423e5d65416b/resources/fonts/{fontstack}/{range}.pbf', + 'sprite': 'https://www.arcgis.com/sharing/rest/content/items/00cd8e843bae49b3a040423e5d65416b/resources/sprites/sprite', 'version': 8, 'sources': { 'esri': { - 'url': '//basemapsdev.arcgis.com/arcgis/rest/services/World_Basemap/VectorTileServer', + 'url': 'https://basemapsdev.arcgis.com/arcgis/rest/services/World_Basemap/VectorTileServer', 'type': 'vector' } }, @@ -472,7 +472,7 @@ define([ map: true, mapRightClickMenu: true, options: { - routeTaskUrl: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route', + routeTaskUrl: 'https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route', routeParams: { directionsLanguage: 'en-US', directionsLengthUnits: units.MILES diff --git a/viewer/js/gis/dijit/Find/nls/resource.js b/viewer/js/gis/dijit/Find/nls/resource.js index 0d5c82f74..3564a898e 100644 --- a/viewer/js/gis/dijit/Find/nls/resource.js +++ b/viewer/js/gis/dijit/Find/nls/resource.js @@ -1,4 +1,4 @@ -// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html +// https://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html define({ root: { selectQuery: 'Select query', diff --git a/viewer/js/gis/dijit/LayerControl/nls/resource.js b/viewer/js/gis/dijit/LayerControl/nls/resource.js index 3910c23cb..98a9848cb 100644 --- a/viewer/js/gis/dijit/LayerControl/nls/resource.js +++ b/viewer/js/gis/dijit/LayerControl/nls/resource.js @@ -1,6 +1,6 @@ // internationalization for LayerControl // -// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html +// https://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html // // if you would like to add a locale please create an issue at // https://github.com/cmv/cmv-app/issues and someone will assist diff --git a/viewer/js/gis/dijit/LayerControl/plugins/legendUtil.js b/viewer/js/gis/dijit/LayerControl/plugins/legendUtil.js index eeef8b35e..830a71792 100644 --- a/viewer/js/gis/dijit/LayerControl/plugins/legendUtil.js +++ b/viewer/js/gis/dijit/LayerControl/plugins/legendUtil.js @@ -82,7 +82,7 @@ define([ _arcgisLegendRequest: function (layer, expandNode, callback, errback) { var index = layer.url.toLowerCase().indexOf('/rest/'); var soap = layer.url.substring(0, index) + layer.url.substring(index + 5, layer.url.length); - var url = 'http://utility.arcgis.com/sharing/tools/legend?soapUrl=' + window.escape(soap); + var url = 'https://utility.arcgis.com/sharing/tools/legend?soapUrl=' + window.escape(soap); if (!has('ie') || has('ie') > 8) { url += '&returnbytes=true'; } diff --git a/viewer/js/gis/dijit/Print/nls/resource.js b/viewer/js/gis/dijit/Print/nls/resource.js index 3c250c54d..fab5aaa97 100644 --- a/viewer/js/gis/dijit/Print/nls/resource.js +++ b/viewer/js/gis/dijit/Print/nls/resource.js @@ -1,4 +1,4 @@ -// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html +// https://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html define({ root: { title: 'Title', diff --git a/viewer/js/gis/dijit/StreetView/nls/resource.js b/viewer/js/gis/dijit/StreetView/nls/resource.js index d417ab380..9645bd886 100644 --- a/viewer/js/gis/dijit/StreetView/nls/resource.js +++ b/viewer/js/gis/dijit/StreetView/nls/resource.js @@ -1,4 +1,4 @@ -// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html +// https://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html define({ root: { messages: { From c2462ce0921a0a9b9c9f6bd7a65769731cc243ce Mon Sep 17 00:00:00 2001 From: Tim McGee Date: Wed, 13 Jul 2016 15:05:07 -0700 Subject: [PATCH 4/4] restore `async: true` to dojoConfig in index.html By default, ESRI uses `async: false` applications load much faster if set to true. This is also the place to add custom locale(s), if desired. --- viewer/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/viewer/index.html b/viewer/index.html index 8edd538da..2b2020236 100644 --- a/viewer/index.html +++ b/viewer/index.html @@ -38,6 +38,11 @@ +