Skip to content

Commit

Permalink
complete viewer, add nls support in basemaps and bookmarks
Browse files Browse the repository at this point in the history
 uniformize keys names to camelCase.
  • Loading branch information
iled committed Jul 14, 2016
1 parent 27cae90 commit 38660d4
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 108 deletions.
59 changes: 30 additions & 29 deletions viewer/js/config/basemaps.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
define([
//'esri/dijit/Basemap',
//'esri/dijit/BasemapLayer'
], function (/* Basemap, BasemapLayer */) {
'dojo/i18n!./nls/main'
], function (/* Basemap, BasemapLayer, */i18n) {

return {
map: true, // needs a reference to the map
mode: 'agol', // mut be either 'agol' or 'custom'
title: 'Basemaps', // title for widget
title: i18n.basemaps.title, // title for widget

/* optional starting basemap
/ otherwise uses the basemap from the map
Expand All @@ -18,51 +19,51 @@ define([
/ otherwise uses keys in basemaps object below
/ values in array must match keys in basemaps object
*/
//basemapsToShow: ['streets', 'satellite', 'hybrid', 'topo', 'lightGray', 'gray', 'national-geographic', 'osm', 'oceans'],
//basemapsToShow: ['streets', 'satellite', 'hybrid', 'topo', 'lightGray', 'gray', 'nationalGeographic', 'osm', 'oceans'],

// define all valid basemaps here.
basemaps: {
streets: {
title: 'Streets'
title: i18n.basemaps.streets
},
'streets-night-vector': { // requires v3.16 or higher
title: 'Streets (Night)'
streetsNightVector: { // requires v3.16 or higher
title: i18n.basemaps.streetsNightVector
},
'streets-navigation-vector': { // requires v3.16 or higher
title: 'Streets (Navigation)'
streetsNavigationVector: { // requires v3.16 or higher
title: i18n.basemaps.streetsNavigationVector
},
'streets-relief-vector': { // requires v3.16 or higher
title: 'Street (Relief)'
streetsReliefVector: { // requires v3.16 or higher
title: i18n.basemaps.streetsReliefVector
},
satellite: {
title: 'Satellite'
title: i18n.basemaps.satellite
},
hybrid: {
title: 'Hybrid'
title: i18n.basemaps.hybrid
},
topo: {
title: 'Topo'
title: i18n.basemaps.topo
},
'terrain': {
title: 'Terrain'
terrain: {
title: i18n.basemaps.terrain
},
'gray-vector': { // requires v3.16 or higher
title: 'Gray'
grayVector: { // requires v3.16 or higher
title: i18n.basemaps.grayVector
},
'dark-gray-vector': { // requires v3.16 or higher
title: 'Dark Gray'
darkGrayVector: { // requires v3.16 or higher
title: i18n.basemaps.darkGrayVector
},
oceans: {
title: 'Oceans'
title: i18n.basemaps.oceans
},
'national-geographic': {
title: 'Nat Geo'
nationalGeographic: {
title: i18n.basemaps.nationalGeographic
},
osm: {
title: 'Open Street Map'
title: i18n.basemaps.osm
},
LandsatShaded: {
title: 'Landsat Shaded',
landsatShaded: {
title: i18n.basemaps.landsatShaded,
basemap: {
baseMapLayers: [
{
Expand All @@ -71,8 +72,8 @@ define([
]
}
},
EarthAtNight: {
title: 'Earth at Night',
earthAtNight: {
title: i18n.basemaps.earthAtNight,
basemap: {
baseMapLayers: [
{
Expand All @@ -81,8 +82,8 @@ define([
]
}
},
DavidRumseyMap1812: {
title: 'David Rumsey 1812',
davidRumseyMap1812: {
title: i18n.basemaps.davidRumseyMap1812,
basemap: {
baseMapLayers: [
{
Expand Down
39 changes: 22 additions & 17 deletions viewer/js/config/bookmarks.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
define({
map: true,
editable: true,
bookmarks: [
{
extent: {
xmin: -15489130.48708616,
ymin: 398794.4860580916,
xmax: -5891085.7193757,
ymax: 8509680.431452557,
spatialReference: {
wkid: 102100
}
},
name: 'USA'
}
]
define([
'dojo/i18n!./nls/main'
], function (i18n) {

return {
map: true,
editable: true,
bookmarks: [
{
extent: {
xmin: -15489130.48708616,
ymin: 398794.4860580916,
xmax: -5891085.7193757,
ymax: 8509680.431452557,
spatialReference: {
wkid: 102100
}
},
name: i18n.bookmarks.usa
}
]
}
});
75 changes: 55 additions & 20 deletions viewer/js/config/nls/main.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,58 @@
// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html
define({
root: {
operationalLayers: {
sf311Incidents: 'San Francisco 311 Incidents'
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: 'Street (Relief)',
terrain: 'Terrain',
title: 'Basemaps',
topo: 'Topographic'
},
bookmarks: {
usa: 'USA'
},
viewer: {
operationalLayers: {
damageAssessment: 'Damage Assessment',
louisvillePubSafety: 'Louisville Public Safety',
restaurants: 'Restaurants',
sf311Incidents: 'San Francisco 311 Incidents',
vectortile1: 'Light Gray Canvas Vector',
vectortile2: 'Custom Vector Style'
},
titles: {
header: 'Configurable Map Viewer',
pageTitle: 'Configurable Map Viewer'
subHeader: 'make it your own',
},
widgets: {
bookmarks: 'Bookmarks',
directions: 'Directions',
draw: 'Draw',
editor: 'Editor',
find: 'Find',
help: 'Help',
identify: 'Identify',
measure: 'Measurement',
layerControl: 'Layers',
legend: 'Legend',
print: 'Print',
streetview: 'Google Street View'
}

},
},
widgetTitles: {
bookmarks: 'Bookmarks',
directions: 'Directions',
draw: 'Draw',
editor: 'Editor',
find: 'Find',
help: 'Help',
identify: 'Identify',
measure: 'Measurement',
layerControl: 'Layers',
legend: 'Legend',
print: 'Print',
streetview: 'Google Street View'
}
},
'pt-pt': true
})
'pt-pt': true
});
48 changes: 29 additions & 19 deletions viewer/js/config/nls/pt-pt/main.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html
define({
root: {
operationalLayers: {
sf311Incidents: 'San Francisco 311 Incidents'
},
widgetTitles: {
bookmarks: 'Marcadores',
directions: 'Direcções',
draw: 'Desenhar',
editor: 'Editor',
find: 'Procurar',
help: 'Ajuda',
identify: 'Identificar',
measure: 'Medir',
layerControl: 'Camadas',
legend: 'Legendas',
print: 'Imprimir',
streetview: 'Google Street View'
viewer: {
operationalLayers: {
damageAssessment: 'Avaliação de dano',
louisvillePubSafety: 'Segurança Pública de Louisville',
restaurants: 'Restaurantes',
sf311Incidents: 'Incidentes do 311 de São Francisco',
vectortile1: 'Tela vectorial cinzento claro',
vectortile2: 'Estilo vectorial personalizado'
},
titles: {
header: 'Configurable Map Viewer',
pageTitle: 'Configurable Map Viewer'
subHeader: 'make it your own',
},
widgets: {
bookmarks: 'Marcadores',
directions: 'Direcções',
draw: 'Desenhar',
editor: 'Editor',
find: 'Procurar',
help: 'Ajuda',
identify: 'Identificar',
measure: 'Medir',
layerControl: 'Camadas',
legend: 'Legendas',
print: 'Imprimir',
streetview: 'Google Street View'
}
}
}
})
});
Loading

0 comments on commit 38660d4

Please sign in to comment.