Skip to content

Commit

Permalink
Merge branch 'develop' into feature/add-support-for-webmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSpriggs authored Nov 2, 2016
2 parents 0ffeae6 + 209d264 commit a24fc95
Show file tree
Hide file tree
Showing 17 changed files with 257 additions and 182 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions viewer/css/cmv-theme-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
background-color: #F5F5F5;
}

.cmv .dijitTitlePaneTitleOpen {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}

.cmv label {
font-weight: bold;
}
Expand Down
86 changes: 30 additions & 56 deletions viewer/js/config/basemaps.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
define([
//'esri/dijit/Basemap',
//'esri/dijit/BasemapLayer'
'esri/dijit/Basemap',
'esri/dijit/BasemapLayer',
'dojo/i18n!./nls/main'
], function (/* Basemap, BasemapLayer, */i18n) {
], function (Basemap, BasemapLayer, i18n) {

return {
map: true, // needs a reference to the map
mode: 'agol', // mut be either 'agol' or 'custom'
//mode: 'agol', // mut be either 'agol' or 'custom'

/* optional starting basemap
/ otherwise uses the basemap from the map
Expand All @@ -22,45 +22,19 @@ define([

// define all valid basemaps here.
basemaps: {
streets: {
title: i18n.basemaps.streets
},
'streets-night-vector': { // requires v3.16 or higher
title: i18n.basemaps.streetsNightVector
},
'streets-navigation-vector': { // requires v3.16 or higher
title: i18n.basemaps.streetsNavigationVector
},
'streets-relief-vector': { // requires v3.16 or higher
title: i18n.basemaps.streetsReliefVector
},
satellite: {
title: i18n.basemaps.satellite
},
hybrid: {
title: i18n.basemaps.hybrid
},
topo: {
title: i18n.basemaps.topo
},
terrain: {
title: i18n.basemaps.terrain
},
'gray-vector': { // requires v3.16 or higher
title: i18n.basemaps.grayVector
},
'dark-gray-vector': { // requires v3.16 or higher
title: i18n.basemaps.darkGrayVector
},
oceans: {
title: i18n.basemaps.oceans
},
'national-geographic': {
title: i18n.basemaps.nationalGeographic
},
osm: {
title: i18n.basemaps.osm
},
streets: {},
'streets-night-vector': {}, // requires v3.16 or higher
'streets-navigation-vector': {}, // requires v3.16 or higher
'streets-relief-vector': {}, // requires v3.16 or higher
satellite: {},
hybrid: {},
topo: {},
terrain: {},
'gray-vector': {}, // requires v3.16 or higher
'dark-gray-vector': {}, // requires v3.16 or higher
oceans: {},
'national-geographic': {},
osm: {},
landsatShaded: {
title: i18n.basemaps.landsatShaded,
basemap: {
Expand Down Expand Up @@ -90,6 +64,19 @@ define([
}
]
}
},
mapboxPirates: {
title: 'Pirates (mapbox.com)',
basemap: new Basemap({
id: 'mapboxPirates',
layers: [new BasemapLayer({
url: 'https://${subDomain}.tiles.mapbox.com/v3/aj.Sketchy2/${level}/${col}/${row}.png',
copyright: 'mapbox, 2016',
id: 'mapboxPirates',
subDomains: ['a', 'b', 'c', 'd'],
type: 'WebTiledLayer'
})]
})
}

// additional examples of vector tile basemaps (requires v3.16 or higher)
Expand Down Expand Up @@ -283,19 +270,6 @@ define([
})]
})
},
mapboxPirates: {
title: 'Pirates (mapbox.com)',
basemap: new Basemap({
id: 'mapboxPirates',
layers: [new BasemapLayer({
url: 'https://${subDomain}.tiles.mapbox.com/v3/aj.Sketchy2/${level}/${col}/${row}.png',
copyright: 'mapbox, 2016',
id: 'mapboxPirates',
subDomains: ['a', 'b', 'c', 'd'],
type: 'WebTiledLayer'
})]
})
}
*/
}
};
Expand Down
16 changes: 1 addition & 15 deletions viewer/js/config/nls/es/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,8 @@
define({
basemaps: {
davidRumseyMap1812: 'David Rumsey 1812',
darkGrayVector: 'Gris oscuro',
earthAtNight: 'Tierra en la noche',
grayVector: 'Gris',
hybrid: 'Híbrido',
landsatShaded: 'Landsat sombreada',
nationalGeographic: 'Nat Geo',
oceans: 'Oceános',
osm: 'Open Street Map',
satellite: 'Satélite',
streets: 'Calle',
streetsNavigationVector: 'Calle (Navegación)',
streetsNightVector: 'Calle (Noche)',
streetsReliefVector: 'Calle (Relieve)',
terrain: 'Terreno',
title: 'Mapas base',
topo: 'Topográfico'
landsatShaded: 'Landsat sombreada'
},
bookmarks: {
nullIsland: 'Isla nula',
Expand Down
15 changes: 1 addition & 14 deletions viewer/js/config/nls/fr/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@
define({
basemaps: {
davidRumseyMap1812: 'David Rumsey 1812',
darkGrayVector: 'Gris foncé',
earthAtNight: 'Terre la nuit',
grayVector: 'Gris',
hybrid: 'Hybride',
landsatShaded: 'Landsat et relief ombragé',
nationalGeographic: 'National Geographic',
oceans: 'Océans',
osm: 'OpenStreetMap',
satellite: 'Image satellitaire',
streets: 'Rues',
streetsNavigationVector: 'Rues (navigation)',
streetsNightVector: 'Rues (nuit)',
streetsReliefVector: 'Rues (relief)',
terrain: 'Terrain',
topo: 'Topographique'
landsatShaded: 'Landsat et relief ombragé'
},
bookmarks: {
nullIsland: 'Île Null',
Expand Down
15 changes: 1 addition & 14 deletions viewer/js/config/nls/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,8 @@ define({
root: {
basemaps: {
davidRumseyMap1812: 'David Rumsey 1812',
darkGrayVector: 'Dark Gray',
earthAtNight: 'Earth at Night',
grayVector: 'Gray',
hybrid: 'Hybrid',
landsatShaded: 'Landsat Shaded',
nationalGeographic: 'Nat Geo',
oceans: 'Oceans',
osm: 'Open Street Map',
satellite: 'Satellite',
streets: 'Streets',
streetsNavigationVector: 'Streets (Navigation)',
streetsNightVector: 'Streets (Night)',
streetsReliefVector: 'Streets (Relief)',
terrain: 'Terrain',
topo: 'Topographic'
landsatShaded: 'Landsat Shaded'
},
bookmarks: {
nullIsland: 'Null Island',
Expand Down
15 changes: 1 addition & 14 deletions viewer/js/config/nls/pt-br/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@
define({
basemaps: {
davidRumseyMap1812: 'David Rumsey 1812',
darkGrayVector: 'Cinzento escuro',
earthAtNight: 'Terra à noite',
grayVector: 'Cinzento',
hybrid: 'Híbrido',
landsatShaded: 'Landsat sombreado',
nationalGeographic: 'National Geographic',
oceans: 'Oceanos',
osm: 'Open Street Map',
satellite: 'Satélite',
streets: 'Ruas',
streetsNavigationVector: 'Ruas (Navegação)',
streetsNightVector: 'Ruas (Nocturno)',
streetsReliefVector: 'Ruas (Relevo)',
terrain: 'Terreno',
topo: 'Topográfico'
landsatShaded: 'Landsat sombreado'
},
bookmarks: {
nullIsland: 'Ilha Nula',
Expand Down
15 changes: 1 addition & 14 deletions viewer/js/config/nls/pt-pt/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@
define({
basemaps: {
davidRumseyMap1812: 'David Rumsey 1812',
darkGrayVector: 'Cinzento escuro',
earthAtNight: 'Terra à noite',
grayVector: 'Cinzento',
hybrid: 'Híbrido',
landsatShaded: 'Landsat sombreado',
nationalGeographic: 'National Geographic',
oceans: 'Oceanos',
osm: 'Open Street Map',
satellite: 'Satélite',
streets: 'Ruas',
streetsNavigationVector: 'Ruas (Navegação)',
streetsNightVector: 'Ruas (Nocturno)',
streetsReliefVector: 'Ruas (Relevo)',
terrain: 'Terreno',
topo: 'Topográfico'
landsatShaded: 'Landsat sombreado'
},
bookmarks: {
nullIsland: 'Ilha Nula',
Expand Down
65 changes: 65 additions & 0 deletions viewer/js/gis/dijit/BasemapGallery.js
Original file line number Diff line number Diff line change
@@ -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);
}
});
});
41 changes: 41 additions & 0 deletions viewer/js/gis/dijit/BasemapGallery/css/BasemapGallery.css
Original file line number Diff line number Diff line change
@@ -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;
}
}
3 changes: 3 additions & 0 deletions viewer/js/gis/dijit/BasemapGallery/nls/es/resource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
define ({
title: 'Mapas base'
});
3 changes: 3 additions & 0 deletions viewer/js/gis/dijit/BasemapGallery/nls/fr/resource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
define ({
title: 'Fond de carte'
});
3 changes: 3 additions & 0 deletions viewer/js/gis/dijit/BasemapGallery/nls/pt-br/resource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
define ({
title: 'Mapas base'
});
3 changes: 3 additions & 0 deletions viewer/js/gis/dijit/BasemapGallery/nls/pt-pt/resource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
define({
title: 'Mapas base'
});
9 changes: 9 additions & 0 deletions viewer/js/gis/dijit/BasemapGallery/nls/resource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
define ({
root: {
title: 'Basemaps'
},
'es': true,
'fr': true,
'pt-br': true,
'pt-pt': true
});
Loading

0 comments on commit a24fc95

Please sign in to comment.