From d5801ca274c31770ad830652cd180864b418c4ef Mon Sep 17 00:00:00 2001 From: Tim McGee Date: Mon, 31 Oct 2016 15:16:41 -0700 Subject: [PATCH 1/2] cleanup the bottom border for titlepanes --- viewer/css/cmv-theme-overrides.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/viewer/css/cmv-theme-overrides.css b/viewer/css/cmv-theme-overrides.css index 0f9875af8..ae740f38d 100644 --- a/viewer/css/cmv-theme-overrides.css +++ b/viewer/css/cmv-theme-overrides.css @@ -12,6 +12,11 @@ background-color: #F5F5F5; } +.cmv .dijitTitlePaneTitleOpen { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + .cmv label { font-weight: bold; } From c426979b0caa5dadfa0e8493544a7c510cc2bb5e Mon Sep 17 00:00:00 2001 From: Tim McGee Date: Mon, 31 Oct 2016 15:35:37 -0700 Subject: [PATCH 2/2] new BasemapGallery widget --- README.md | 3 +- viewer/js/gis/dijit/BasemapGallery.js | 65 +++++++++++++++++++ .../BasemapGallery/css/BasemapGallery.css | 41 ++++++++++++ .../dijit/BasemapGallery/nls/es/resource.js | 3 + .../dijit/BasemapGallery/nls/fr/resource.js | 3 + .../BasemapGallery/nls/pt-br/resource.js | 3 + .../BasemapGallery/nls/pt-pt/resource.js | 3 + .../gis/dijit/BasemapGallery/nls/resource.js | 9 +++ .../templates/BasemapGallery.html | 7 ++ 9 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 viewer/js/gis/dijit/BasemapGallery.js create mode 100644 viewer/js/gis/dijit/BasemapGallery/css/BasemapGallery.css create mode 100644 viewer/js/gis/dijit/BasemapGallery/nls/es/resource.js create mode 100644 viewer/js/gis/dijit/BasemapGallery/nls/fr/resource.js create mode 100644 viewer/js/gis/dijit/BasemapGallery/nls/pt-br/resource.js create mode 100644 viewer/js/gis/dijit/BasemapGallery/nls/pt-pt/resource.js create mode 100644 viewer/js/gis/dijit/BasemapGallery/nls/resource.js create mode 100644 viewer/js/gis/dijit/BasemapGallery/templates/BasemapGallery.html diff --git a/README.md b/README.md index d3b1fb678..b2f9d9514 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ This JavaScript web app can be easily configured or used as a boilerplate/starti ![screen shot 2014-08-20 at 9 59 48 pm](https://cloud.githubusercontent.com/assets/661156/3991302/5aa2e0f2-28df-11e4-94d0-9c813937d933.png) ## Widgets Included: -- Base Maps +- Basemaps +- Basemaps Gallery - Bookmarks - Directions - Draw diff --git a/viewer/js/gis/dijit/BasemapGallery.js b/viewer/js/gis/dijit/BasemapGallery.js new file mode 100644 index 000000000..9b0c5b31a --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery.js @@ -0,0 +1,65 @@ +define([ + 'dojo/_base/declare', + 'dijit/_WidgetBase', + 'dijit/_TemplatedMixin', + 'dijit/_WidgetsInTemplateMixin', + + 'dojo/_base/lang', + 'dojo/topic', + + 'esri/dijit/BasemapGallery', + + 'dojo/text!./BasemapGallery/templates/BasemapGallery.html', + 'dojo/i18n!./BasemapGallery/nls/resource', + + 'dijit/layout/ContentPane', + 'dijit/TitlePane', + + 'xstyle/css!./BasemapGallery/css/BasemapGallery.css' + +], function ( + declare, + _WidgetBase, + _TemplatedMixin, + _WidgetsInTemplateMixin, + + lang, + topic, + + BasemapGallery, + + template, + i18n +) { + + return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { + widgetsInTemplate: true, + templateString: template, + i18n: i18n, + baseClass: 'cmvBasemapGalleryWidget', + + galleryOptions: { + showArcGISBasemaps: true + }, + + postCreate: function () { + this.inherited(arguments); + + var opts = lang.mixin({ + map: this.map + }, this.galleryOptions || {}); + this.basemapGallery = new BasemapGallery(opts, 'basemapGallery'); + this.basemapGallery.startup(); + + this.basemapGallery.on('selection-change', lang.hitch(this, 'basemapSelected')); + + this.basemapGallery.on('error', function (msg) { + topic.publish('viewer/handleError', 'basemap gallery error: ' + msg); + }); + }, + + basemapSelected: function (/* basemap */) { + this.basemapGalleryTitlePane.set('open', false); + } + }); +}); \ No newline at end of file diff --git a/viewer/js/gis/dijit/BasemapGallery/css/BasemapGallery.css b/viewer/js/gis/dijit/BasemapGallery/css/BasemapGallery.css new file mode 100644 index 000000000..4bb99ef2b --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery/css/BasemapGallery.css @@ -0,0 +1,41 @@ +.cmvBasemapGalleryWidget .dijitTitlePane { + border-radius: 4px; +} + +.cmvBasemapGalleryWidget .dijitTitlePaneTitle { + border-color: #BBB; + padding: 4px; +} + +.cmvBasemapGalleryWidget .dijitTitlePane .dijitArrowNode { + float: right; + padding-top: 3px; +} + +.cmvBasemapGalleryWidget .dijitTitlePaneTextNode:before { + content: '\f009'; + font-family: FontAwesome; +} + +.cmvBasemapGalleryWidget .dijitTitlePaneContentOuter { + border-color: #BBB; +} + +.cmvBasemapGalleryWidget .dijitTitlePaneContentInner { + padding: 0; +} + +.cmvBasemapGalleryWidget .basemapGalleryContent { + height: 280px; + overflow:auto; + width: 410px; +} +.cmvBasemapGalleryWidget .esriBasemapGalleryNode { + margin: 5px 15px; +} + +@media screen and (max-width: 767px) { + .cmvBasemapGalleryWidget .basemapGalleryContent { + width: 140px; + } +} \ No newline at end of file diff --git a/viewer/js/gis/dijit/BasemapGallery/nls/es/resource.js b/viewer/js/gis/dijit/BasemapGallery/nls/es/resource.js new file mode 100644 index 000000000..48f8546d9 --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery/nls/es/resource.js @@ -0,0 +1,3 @@ +define ({ + title: 'Mapas base' +}); \ No newline at end of file diff --git a/viewer/js/gis/dijit/BasemapGallery/nls/fr/resource.js b/viewer/js/gis/dijit/BasemapGallery/nls/fr/resource.js new file mode 100644 index 000000000..1717b565f --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery/nls/fr/resource.js @@ -0,0 +1,3 @@ +define ({ + title: 'Fond de carte' +}); \ No newline at end of file diff --git a/viewer/js/gis/dijit/BasemapGallery/nls/pt-br/resource.js b/viewer/js/gis/dijit/BasemapGallery/nls/pt-br/resource.js new file mode 100644 index 000000000..48f8546d9 --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery/nls/pt-br/resource.js @@ -0,0 +1,3 @@ +define ({ + title: 'Mapas base' +}); \ No newline at end of file diff --git a/viewer/js/gis/dijit/BasemapGallery/nls/pt-pt/resource.js b/viewer/js/gis/dijit/BasemapGallery/nls/pt-pt/resource.js new file mode 100644 index 000000000..d67f99c97 --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery/nls/pt-pt/resource.js @@ -0,0 +1,3 @@ +define({ + title: 'Mapas base' +}); \ No newline at end of file diff --git a/viewer/js/gis/dijit/BasemapGallery/nls/resource.js b/viewer/js/gis/dijit/BasemapGallery/nls/resource.js new file mode 100644 index 000000000..99c7c0fae --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery/nls/resource.js @@ -0,0 +1,9 @@ +define ({ + root: { + title: 'Basemaps' + }, + 'es': true, + 'fr': true, + 'pt-br': true, + 'pt-pt': true +}); \ No newline at end of file diff --git a/viewer/js/gis/dijit/BasemapGallery/templates/BasemapGallery.html b/viewer/js/gis/dijit/BasemapGallery/templates/BasemapGallery.html new file mode 100644 index 000000000..26ea418e5 --- /dev/null +++ b/viewer/js/gis/dijit/BasemapGallery/templates/BasemapGallery.html @@ -0,0 +1,7 @@ +
+
+
+
+
+
+
\ No newline at end of file