Skip to content

Commit

Permalink
Merge pull request #572 from iled/develop
Browse files Browse the repository at this point in the history
Add nls support in config files, add pt-pt translation
  • Loading branch information
DavidSpriggs authored Jul 15, 2016
2 parents f229b6e + 131ed06 commit b4bb19c
Show file tree
Hide file tree
Showing 27 changed files with 570 additions and 243 deletions.
49 changes: 25 additions & 24 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 @@ -23,46 +24,46 @@ define([
// define all valid basemaps here.
basemaps: {
streets: {
title: 'Streets'
title: i18n.basemaps.streets
},
'streets-night-vector': { // requires v3.16 or higher
title: 'Streets (Night)'
title: i18n.basemaps.streetsNightVector
},
'streets-navigation-vector': { // requires v3.16 or higher
title: 'Streets (Navigation)'
title: i18n.basemaps.streetsNavigationVector
},
'streets-relief-vector': { // requires v3.16 or higher
title: 'Street (Relief)'
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'
title: i18n.basemaps.grayVector
},
'dark-gray-vector': { // requires v3.16 or higher
title: 'Dark Gray'
title: i18n.basemaps.darkGrayVector
},
oceans: {
title: 'Oceans'
title: i18n.basemaps.oceans
},
'national-geographic': {
title: 'Nat Geo'
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 Expand Up @@ -141,7 +142,7 @@ define([
]
}
},
darkGrayVector: {
'dark-gray-vector': {
title: 'Dark Gray Canvas',
basemap: {
baseMapLayers: [
Expand All @@ -163,7 +164,7 @@ define([
]
}
},
streetsNightVector: {
'streets-night-vector': {
title: 'Streets Night',
basemap: {
baseMapLayers: [
Expand Down
49 changes: 33 additions & 16 deletions viewer/js/config/bookmarks.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
define({
map: true,
editable: true,
bookmarks: [
{
extent: {
xmin: -15489130.48708616,
ymin: 398794.4860580916,
xmax: -5891085.7193757,
ymax: 8509680.431452557,
spatialReference: {
wkid: 102100
}
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
},
name: 'USA'
}
]
{
extent: {
xmin: 0,
ymin: 0,
xmax: 0,
ymax: 0,
spatialReference: {
wkid: 102100
}
},
name: i18n.bookmarks.nullIsland
}
]
};
});
215 changes: 110 additions & 105 deletions viewer/js/config/find.js
Original file line number Diff line number Diff line change
@@ -1,112 +1,117 @@
/*eslint no-console: 0, no-alert: 0*/
define({
map: true,
zoomExtentFactor: 2,
queries: [
{
description: 'Find A Public Safety Location By Name',
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,
gridColumns: [
{
field: 'Name',
label: 'Name'
},
{
field: 'layerName',
label: 'Layer',
width: 100,
sortable: false,
resizable: false
}
],
sort: [
{
attribute: 'Name',
descending: false
}
],
prompt: 'fdname, pdname, name or resname',
selectionMode: 'single'
},
{
description: 'Find Incident By Code/Description',
url: 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer',
layerIds: [15, 17, 18],
searchFields: ['FCODE', 'DESCRIPTION'],
minChars: 4,
gridColumns: [
{
field: 'layerName',
label: 'Layer',
width: 100,
sortable: false,
resizable: false
},
{
field: 'Fcode',
label: 'Fcode',
width: 100
},
{
field: 'Description',
label: 'Descr'
},
{
field: 'SORT_VALUE',
visible: false,
get: function (findResult) {
return findResult.layerName + ' ' + findResult.feature.attributes.Fcode; //seems better to use attributes[ 'Fcode' ] but fails build. Attribute names will be aliases and may contain spaces and mixed cases.
define([
'dojo/i18n!./nls/main'
], function (i18n) {

return {
map: true,
zoomExtentFactor: 2,
queries: [
{
description: i18n.find.louisvillePubSafety,
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,
gridColumns: [
{
field: 'Name',
label: 'Name'
},
{
field: 'layerName',
label: 'Layer',
width: 100,
sortable: false,
resizable: false
}
}
],
sort: [
{
attribute: 'SORT_VALUE',
descending: false
}
],
prompt: 'fdname, pdname, name or resname',
customGridEventHandlers: [
{
event: '.dgrid-row:click',
handler: function (event) {
alert('You clicked a row!');
console.log(event);
],
sort: [
{
attribute: 'Name',
descending: false
}
],
prompt: 'fdname, pdname, name or resname',
selectionMode: 'single'
},
{
description: i18n.find.sf311Incidents,
url: 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer',
layerIds: [15, 17, 18],
searchFields: ['FCODE', 'DESCRIPTION'],
minChars: 4,
gridColumns: [
{
field: 'layerName',
label: 'Layer',
width: 100,
sortable: false,
resizable: false
},
{
field: 'Fcode',
label: 'Fcode',
width: 100
},
{
field: 'Description',
label: 'Descr'
},
{
field: 'SORT_VALUE',
visible: false,
get: function (findResult) {
return findResult.layerName + ' ' + findResult.feature.attributes.Fcode; //seems better to use attributes[ 'Fcode' ] but fails build. Attribute names will be aliases and may contain spaces and mixed cases.
}
}
],
sort: [
{
attribute: 'SORT_VALUE',
descending: false
}
],
prompt: 'fdname, pdname, name or resname',
customGridEventHandlers: [
{
event: '.dgrid-row:click',
handler: function (event) {
alert('You clicked a row!');
console.log(event);
}
}
]
}
],
selectionSymbols: {
polygon: {
type: 'esriSFS',
style: 'esriSFSSolid',
color: [255, 0, 0, 62],
outline: {
type: 'esriSLS',
style: 'esriSLSSolid',
color: [255, 0, 0, 255],
width: 3
}
},
point: {
type: 'esriSMS',
style: 'esriSMSCircle',
size: 25,
color: [255, 0, 0, 62],
angle: 0,
xoffset: 0,
yoffset: 0,
outline: {
type: 'esriSLS',
style: 'esriSLSSolid',
color: [255, 0, 0, 255],
width: 2
}
]
}
],
selectionSymbols: {
polygon: {
type: 'esriSFS',
style: 'esriSFSSolid',
color: [255, 0, 0, 62],
outline: {
type: 'esriSLS',
style: 'esriSLSSolid',
color: [255, 0, 0, 255],
width: 3
}
},
point: {
type: 'esriSMS',
style: 'esriSMSCircle',
size: 25,
color: [255, 0, 0, 62],
angle: 0,
xoffset: 0,
yoffset: 0,
outline: {
type: 'esriSLS',
style: 'esriSLSSolid',
color: [255, 0, 0, 255],
width: 2
}
}
},
selectionMode: 'extended'
selectionMode: 'extended'
};
});
Loading

0 comments on commit b4bb19c

Please sign in to comment.