\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Basemaps.js b/viewer/js/gis/dijit/Basemaps.js
index a0deaee34..72a9dbbce 100644
--- a/viewer/js/gis/dijit/Basemaps.js
+++ b/viewer/js/gis/dijit/Basemaps.js
@@ -7,7 +7,6 @@ define([
'dojo/_base/lang',
'dojo/_base/array',
'dojo/topic',
- 'dojox/lang/functional',
'dijit/DropDownMenu',
'dijit/MenuItem',
@@ -29,7 +28,6 @@ define([
lang,
array,
topic,
- functional,
DropDownMenu,
MenuItem,
@@ -46,62 +44,93 @@ define([
widgetsInTemplate: true,
i18n: i18n,
title: i18n.title,
- mode: 'agol',
basemaps: {},
currentBasemap: null,
mapStartBasemap: null,
basemapsToShow: null,
+ galleryOptions: {
+ basemapIds: null,
+ basemaps: null,
+ basemapsGroup: null,
+ bingMapsKey: null,
+ portalUrl: null,
+ referenceIds: null,
+ showArcGISBasemaps: false
+ },
postCreate: function () {
this.inherited(arguments);
+ this.initializeBasemaps();
+ this.createBasemapGallery();
+ topic.subscribe('basemaps/updateBasemap', lang.hitch(this, 'updateBasemap'));
+ },
- // if the basemaps to show is not explicitly set,
- // get them from the basemap object
- if (!this.basemapsToShow) {
- this.basemapsToShow = Object.keys(this.basemaps);
- }
+ initializeBasemaps: function () {
+ if (this.galleryOptions.basemaps) {
+ // if the basemaps to show is not explicitly set, get them from the gallery's basemap array
+ this.basemapsToShow = this.basemapsToShow || array.map(this.galleryOptions.basemaps, function (basemap) {
+ return basemap.id;
+ });
+ } else {
+ // no basemaps? use the Esri basemaps
+ if (!this.basemaps || Object.keys(this.basemaps).length < 1) {
+ this.basemaps = lang.clone(esriBasemaps);
+ this.galleryOptions.showArcGISBasemaps = false;
+ }
- // if the starting basemap is not explicitly set,
- // get it from the map
- if (!this.mapStartBasemap) {
- this.mapStartBasemap = this.map.getBasemap();
+ // if the basemaps to show is not explicitly set, get them from the basemap object
+ this.basemapsToShow = this.basemapsToShow || Object.keys(this.basemaps);
+
+ var basemaps = [];
+ array.forEach(this.basemapsToShow, lang.hitch(this, function (key) {
+ var map = this.basemaps[key];
+ // determine if it is a custom basemap or an esri basemap
+ if (map.basemap && map.basemap.declaredClass === 'esri.dijit.Basemap') {
+ var basemap = map.basemap;
+ basemap.title = map.title || basemap.title;
+ basemap.id = key;
+ basemaps.push(basemap);
+ } else {
+ if (!esriBasemaps[key]) {
+ map.basemap.title = map.title || map.basemap.title;
+ esriBasemaps[key] = map.basemap;
+ }
+ map.title = map.title || esriBasemaps[key].title;
+ this.galleryOptions.showArcGISBasemaps = false;
+ }
+ }));
+ this.galleryOptions.basemaps = basemaps;
}
- // check to make sure the starting basemap
- // is found in the basemaps object
- if (!this.basemaps.hasOwnProperty(this.mapStartBasemap)) {
+ // if the starting basemap is not explicitly set, get it from the map
+ this.mapStartBasemap = this.mapStartBasemap || this.map.getBasemap();
+
+ // check to make sure the starting basemap is found in the basemaps object
+ if (array.indexOf(this.basemapsToShow, this.mapStartBasemap) < 0) {
this.mapStartBasemap = this.basemapsToShow[0];
}
+ },
- if (this.mode === 'custom') {
- this.gallery = new BasemapGallery({
- map: this.map,
- showArcGISBasemaps: false,
- basemaps: functional.map(this.basemaps, function (map) {
- return map.basemap;
- })
- });
- this.gallery.startup();
+ createBasemapGallery: function () {
+ var opts = lang.mixin({
+ map: this.map
+ }, this.galleryOptions);
+ this.gallery = new BasemapGallery(opts);
+ this.gallery.startup();
+ if (this.galleryOptions.showArcGISBasemaps) {
+ this.gallery.on('load', lang.hitch(this, 'buildMenu'));
+ } else {
+ this.buildMenu();
}
+ },
+
+ buildMenu: function () {
this.menu = new DropDownMenu({
style: 'display: none;'
});
-
array.forEach(this.basemapsToShow, function (basemap) {
if (this.basemaps.hasOwnProperty(basemap)) {
- if (this.mode !== 'custom') {
- // add any custom to the esri basemaps
- var basemapObj = this.basemaps[basemap];
- if (basemapObj.basemap) {
- if (!esriBasemaps[basemap]) {
- if (!basemapObj.basemap.title) {
- basemapObj.basemap.title = basemapObj.title || basemap;
- }
- esriBasemaps[basemap] = basemapObj.basemap;
- }
- }
- }
var menuItem = new MenuItem({
id: basemap,
label: this.basemaps[basemap].title,
@@ -111,22 +140,29 @@ define([
this.menu.addChild(menuItem);
}
}, this);
- topic.subscribe('basemaps/updateBasemap', lang.hitch(this, 'updateBasemap'));
this.dropDownButton.set('dropDown', this.menu);
+ this.setStartingBasemap();
+ },
+
+ setStartingBasemap: function () {
+ if (this.mapStartBasemap && (this.gallery.get(this.mapStartBasemap) || esriBasemaps[this.mapStartBasemap])) {
+ this.updateBasemap(this.mapStartBasemap);
+ }
},
updateBasemap: function (basemap) {
if (basemap !== this.currentBasemap && (array.indexOf(this.basemapsToShow, basemap) !== -1)) {
- if (!this.basemaps.hasOwnProperty(basemap)) {
- return;
- }
- this.currentBasemap = basemap;
- if (this.mode === 'custom') {
+ if (this.gallery.get(basemap)) {
this.gallery.select(basemap);
- } else {
+ } else if (esriBasemaps[basemap]) {
+ this.gallery._removeBasemapLayers();
+ this.gallery._removeReferenceLayer();
this.map.setBasemap(basemap);
+ } else {
+ topic.publish('viewer/error', 'Invalid basemap selected.');
+ return;
}
-
+ this.currentBasemap = basemap;
var ch = this.menu.getChildren();
array.forEach(ch, function (c) {
if (c.id === basemap) {
@@ -136,15 +172,6 @@ define([
}
});
}
- },
-
- startup: function () {
- this.inherited(arguments);
- if (this.mapStartBasemap) {
- if (this.map.getBasemap() !== this.mapStartBasemap) {
- this.updateBasemap(this.mapStartBasemap);
- }
- }
}
});
});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Basemaps/nls/es/resource.js b/viewer/js/gis/dijit/Basemaps/nls/es/resource.js
new file mode 100644
index 000000000..48f8546d9
--- /dev/null
+++ b/viewer/js/gis/dijit/Basemaps/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/Basemaps/nls/fr/resource.js b/viewer/js/gis/dijit/Basemaps/nls/fr/resource.js
new file mode 100644
index 000000000..1717b565f
--- /dev/null
+++ b/viewer/js/gis/dijit/Basemaps/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/Basemaps/nls/pt-br/resource.js b/viewer/js/gis/dijit/Basemaps/nls/pt-br/resource.js
new file mode 100644
index 000000000..48f8546d9
--- /dev/null
+++ b/viewer/js/gis/dijit/Basemaps/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/Basemaps/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Basemaps/nls/pt-pt/resource.js
new file mode 100644
index 000000000..d67f99c97
--- /dev/null
+++ b/viewer/js/gis/dijit/Basemaps/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/Basemaps/nls/resource.js b/viewer/js/gis/dijit/Basemaps/nls/resource.js
index b7dace410..99c7c0fae 100644
--- a/viewer/js/gis/dijit/Basemaps/nls/resource.js
+++ b/viewer/js/gis/dijit/Basemaps/nls/resource.js
@@ -1,5 +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/Directions.js b/viewer/js/gis/dijit/Directions.js
index 524c9cf37..88fcbac5d 100644
--- a/viewer/js/gis/dijit/Directions.js
+++ b/viewer/js/gis/dijit/Directions.js
@@ -12,8 +12,9 @@ define([
'esri/geometry/Point',
'esri/SpatialReference',
'dojo/topic',
- 'dojo/i18n!./Directions/nls/resource'
-], function (declare, _WidgetBase, _TemplatedMixin, Directions, template, lang, Menu, MenuItem, PopupMenuItem, MenuSeparator, Point, SpatialReference, topic, i18n) {
+ 'dojo/i18n!./Directions/nls/resource',
+ 'dojo/dom-style'
+], function (declare, _WidgetBase, _TemplatedMixin, Directions, template, lang, Menu, MenuItem, PopupMenuItem, MenuSeparator, Point, SpatialReference, topic, i18n, domStyle) {
return declare([_WidgetBase, _TemplatedMixin], {
templateString: template,
@@ -27,12 +28,14 @@ define([
//temp fix for 3.12 and 3.13 map click button.
if (this.directions._activateButton) {
- this.directions._activateButton.style.display = 'none';
+ domStyle.set(this.directions._activateButton, 'display', 'none');
} else if (this.directions._activateButtonNode) {
- this.directions._activateButtonNode.style.display = 'none';
- this.directions._addDestinationNode.style.float = 'inherit';
- this.directions._optionsButtonNode.style.float = 'inherit';
- this.directions._optionsButtonNode.style.marginRight = '5px';
+ domStyle.set(this.directions._activateButtonNode, 'display', 'none');
+ domStyle.set(this.directions._addDestinationNode, 'float', 'inherit');
+ domStyle.set(this.directions._optionsButtonNode, {
+ 'float': 'inherit',
+ marginRight: '5px'
+ });
}
if (this.mapRightClickMenu) {
@@ -130,4 +133,4 @@ define([
});
}
});
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/Directions/nls/es/resource.js b/viewer/js/gis/dijit/Directions/nls/es/resource.js
new file mode 100644
index 000000000..0f1f0d9e0
--- /dev/null
+++ b/viewer/js/gis/dijit/Directions/nls/es/resource.js
@@ -0,0 +1,23 @@
+define ({
+ labels: {
+ startAtMyLocation: 'comenzará a mi ubicación',
+ endAtMyLocation: 'terminar en mi ubicación',
+ clearStops: 'paradas claras',
+ addStop: 'Añadir parada',
+ directionsToHere: 'Direcciones a aquí',
+ directionsFromHere: 'Direcciones de aquí',
+ useMyLocationAsStart: 'Usar mi ubicación como punto de inicio',
+ useMyLocationAsEnd: 'Usar mi ubicación como punto final',
+ directions: 'Direcciones'
+ },
+ errors: {
+ geoLocation: {
+ title: 'Error',
+ message: 'No geolocalización apoyado por su hojeanr.'
+ },
+ location: {
+ title: 'Error',
+ message: 'Hubo un problema con su ubicación: '
+ }
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Directions/nls/fr/resource.js b/viewer/js/gis/dijit/Directions/nls/fr/resource.js
new file mode 100644
index 000000000..2cc3dd12c
--- /dev/null
+++ b/viewer/js/gis/dijit/Directions/nls/fr/resource.js
@@ -0,0 +1,23 @@
+define ({
+ labels: {
+ startAtMyLocation: 'Commencer à mon endroit',
+ endAtMyLocation: 'Terminer à mon endroit',
+ clearStops: 'Supprimer les arrêts',
+ addStop: 'Ajouter un arrêt',
+ directionsToHere: 'Directions vers ici',
+ directionsFromHere: 'Directions à partir d\'ici',
+ useMyLocationAsStart: 'Utiliser ma position comme point de départ',
+ useMyLocationAsEnd: 'Utiliser ma position comme point final',
+ directions: 'Directions'
+ },
+ errors: {
+ geoLocation: {
+ title: 'Erreur',
+ message: 'Géolocalisation non supporté par votre navigateur.'
+ },
+ location: {
+ title: 'Erreur',
+ message: 'Il y a un problème pour obtenir votre position: '
+ }
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Directions/nls/pt-br/resource.js b/viewer/js/gis/dijit/Directions/nls/pt-br/resource.js
new file mode 100644
index 000000000..51bf9d23f
--- /dev/null
+++ b/viewer/js/gis/dijit/Directions/nls/pt-br/resource.js
@@ -0,0 +1,23 @@
+define({
+ labels: {
+ startAtMyLocation: 'Inicie na minha Localização',
+ endAtMyLocation: 'Termine na minha Localização',
+ clearStops: 'Limpar paradas',
+ addStop: 'Adicionar parada',
+ directionsToHere: 'Direções para aqui',
+ directionsFromHere: 'Direções daqui',
+ useMyLocationAsStart: 'Use minha Localização como ponto de início',
+ useMyLocationAsEnd: 'Use minha Localização como ponto final',
+ directions: 'Direções'
+ },
+ errors: {
+ geoLocation: {
+ title: 'Erro',
+ message: 'GeoLocalização não suportada no seu navegador.'
+ },
+ location: {
+ title: 'Erro',
+ message: 'Houve um problema ao buscar sua Localização: '
+ }
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Directions/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Directions/nls/pt-pt/resource.js
new file mode 100644
index 000000000..e1ccff40e
--- /dev/null
+++ b/viewer/js/gis/dijit/Directions/nls/pt-pt/resource.js
@@ -0,0 +1,23 @@
+define({
+ labels: {
+ startAtMyLocation: 'iniciar na minha localização',
+ endAtMyLocation: 'terminar na minha localização',
+ clearStops: 'limpar paragens',
+ addStop: 'Adicionar paragem',
+ directionsToHere: 'Direcções para aqui',
+ directionsFromHere: 'Direcções a partir daqui',
+ useMyLocationAsStart: 'Usar a minha localização como ponto inicial',
+ useMyLocationAsEnd: 'Usar a minha localização como ponto final',
+ directions: 'Direcções'
+ },
+ errors: {
+ geoLocation: {
+ title: 'Erro',
+ message: 'GeoLocalização não suportada no seu navegador.'
+ },
+ location: {
+ title: 'Erro',
+ message: 'Ocorreu um problema ao obter a sua localização: '
+ }
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Directions/nls/resource.js b/viewer/js/gis/dijit/Directions/nls/resource.js
index 125b2e678..b1db86f01 100644
--- a/viewer/js/gis/dijit/Directions/nls/resource.js
+++ b/viewer/js/gis/dijit/Directions/nls/resource.js
@@ -21,5 +21,9 @@ define ({
message: 'There was a problem getting your location: '
}
}
- }
+ },
+ 'es': true,
+ 'fr': true,
+ 'pt-br': true,
+ 'pt-pt': true
});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Draw/nls/es/resource.js b/viewer/js/gis/dijit/Draw/nls/es/resource.js
new file mode 100644
index 000000000..32e5d4098
--- /dev/null
+++ b/viewer/js/gis/dijit/Draw/nls/es/resource.js
@@ -0,0 +1,14 @@
+define ({
+ labels: {
+ point: 'Punto',
+ circle: 'Circulo',
+ polyline: 'Polilínea',
+ freehandPolyline: 'Polilínea a mano alzada',
+ polygon: 'Polígono',
+ freehandPolygon: 'Polígono a mano alzada',
+ stopDrawing: 'Comienzo dibujo',
+ clearDrawing: 'Despejar dibujo',
+ currentDrawMode: 'El modo de dibujo:',
+ currentDrawModeNone: 'Nada'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Draw/nls/fr/resource.js b/viewer/js/gis/dijit/Draw/nls/fr/resource.js
new file mode 100644
index 000000000..93c4c0146
--- /dev/null
+++ b/viewer/js/gis/dijit/Draw/nls/fr/resource.js
@@ -0,0 +1,14 @@
+define ({
+ labels: {
+ point: 'Point',
+ circle: 'Cercle',
+ polyline: 'Polyline',
+ freehandPolyline: 'Polyligne à main levée',
+ polygon: 'Polygone',
+ freehandPolygon: 'Polygone à main levée',
+ stopDrawing: 'Terminer le dessin',
+ clearDrawing: 'Effacer le dessin',
+ currentDrawMode: 'Mode de dessin:',
+ currentDrawModeNone: 'Aucun'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Draw/nls/pt-br/resource.js b/viewer/js/gis/dijit/Draw/nls/pt-br/resource.js
new file mode 100644
index 000000000..4192728c6
--- /dev/null
+++ b/viewer/js/gis/dijit/Draw/nls/pt-br/resource.js
@@ -0,0 +1,14 @@
+define({
+ labels: {
+ point: 'Ponto',
+ circle: 'Círculo',
+ polyline: 'Polilinha',
+ freehandPolyline: 'Polilinha a Mão Livre',
+ polygon: 'Polígono',
+ freehandPolygon: 'Polígono a Mão Livre',
+ stopDrawing: 'Parar de Desenhar',
+ clearDrawing: 'Limpar Desenhos',
+ currentDrawMode: 'Modo de desenho atual:',
+ currentDrawModeNone: 'Nenhum'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Draw/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Draw/nls/pt-pt/resource.js
new file mode 100644
index 000000000..9dc6144bb
--- /dev/null
+++ b/viewer/js/gis/dijit/Draw/nls/pt-pt/resource.js
@@ -0,0 +1,14 @@
+define({
+ labels: {
+ point: 'Ponto',
+ circle: 'Círculo',
+ polyline: 'Polilinha',
+ freehandPolyline: 'Polilinha à mão livre',
+ polygon: 'Polígono',
+ freehandPolygon: 'Polígono à mão livre',
+ stopDrawing: 'Parar de desenhar',
+ clearDrawing: 'Limpar desenhos',
+ currentDrawMode: 'Modo de desenho actual:',
+ currentDrawModeNone: 'Nenhum'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Draw/nls/resource.js b/viewer/js/gis/dijit/Draw/nls/resource.js
index 29c6ab534..b55a4fd3c 100644
--- a/viewer/js/gis/dijit/Draw/nls/resource.js
+++ b/viewer/js/gis/dijit/Draw/nls/resource.js
@@ -12,5 +12,9 @@ define ({
currentDrawMode: 'Current draw mode:',
currentDrawModeNone: 'None'
}
- }
+ },
+ 'es': true,
+ 'fr': true,
+ 'pt-br': true,
+ 'pt-pt': true
});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Editor/nls/es/resource.js b/viewer/js/gis/dijit/Editor/nls/es/resource.js
new file mode 100644
index 000000000..445721fa7
--- /dev/null
+++ b/viewer/js/gis/dijit/Editor/nls/es/resource.js
@@ -0,0 +1,6 @@
+define ({
+ labels: {
+ startEditing: 'Comenzar a editar',
+ stopEditing: 'Detener la edición'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Editor/nls/fr/resource.js b/viewer/js/gis/dijit/Editor/nls/fr/resource.js
new file mode 100644
index 000000000..237f02020
--- /dev/null
+++ b/viewer/js/gis/dijit/Editor/nls/fr/resource.js
@@ -0,0 +1,6 @@
+define ({
+ labels: {
+ startEditing: 'Commencez à éditer',
+ stopEditing: 'Arrêter l\'édition'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Editor/nls/pt-br/resource.js b/viewer/js/gis/dijit/Editor/nls/pt-br/resource.js
new file mode 100644
index 000000000..79974dfec
--- /dev/null
+++ b/viewer/js/gis/dijit/Editor/nls/pt-br/resource.js
@@ -0,0 +1,6 @@
+define({
+ labels: {
+ startEditing: 'Iniciar Edição',
+ stopEditing: 'Parar Edição'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Editor/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Editor/nls/pt-pt/resource.js
new file mode 100644
index 000000000..5c499062e
--- /dev/null
+++ b/viewer/js/gis/dijit/Editor/nls/pt-pt/resource.js
@@ -0,0 +1,6 @@
+define({
+ labels: {
+ startEditing: 'Iniciar edição',
+ stopEditing: 'Parar edição'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Editor/nls/resource.js b/viewer/js/gis/dijit/Editor/nls/resource.js
index e24f161fb..5320f6518 100644
--- a/viewer/js/gis/dijit/Editor/nls/resource.js
+++ b/viewer/js/gis/dijit/Editor/nls/resource.js
@@ -4,5 +4,9 @@ define ({
startEditing: 'Start editing',
stopEditing: 'Stop editing'
}
- }
+ },
+ 'es': true,
+ 'fr': true,
+ 'pt-br': true,
+ 'pt-pt': true
});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Find.js b/viewer/js/gis/dijit/Find.js
index 71d7d5242..e8bea99f7 100644
--- a/viewer/js/gis/dijit/Find.js
+++ b/viewer/js/gis/dijit/Find.js
@@ -29,6 +29,7 @@ define([
'dijit/form/FilteringSelect',
'dijit/form/ValidationTextBox',
'dijit/form/CheckBox',
+ 'dijit/form/Button',
'xstyle/css!./Find/css/Find.css'
], function (
declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, domConstruct, lang, array, on, keys, domStyle, Memory,
@@ -594,4 +595,4 @@ define([
}
}
);
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/Find/nls/es/resource.js b/viewer/js/gis/dijit/Find/nls/es/resource.js
new file mode 100644
index 000000000..0efc73504
--- /dev/null
+++ b/viewer/js/gis/dijit/Find/nls/es/resource.js
@@ -0,0 +1,25 @@
+define ({
+ selectQuery: 'Consulta de selección',
+ searchText: {
+ label: 'Buscar',
+ placeholder: 'Introduzca el texto que desea buscar.'
+ },
+ exactMatches: 'Buscar sólo coincidencias exactas',
+ searchButton: {
+ label: 'Buscar',
+ busyLabel: 'buscando'
+ },
+ clearButton: {
+ label: 'Despejar'
+ },
+ searching: 'Buscando...',
+ resultsLabel: {
+ multipleResultsSuffix: 's',
+ labelPrefix: 'Resultado',
+ labelSuffix: 'encontró'
+ },
+ noResultsLabel: 'No se han encontrado resultados.',
+ optionsLabel: 'Opciones',
+ zoomOnSelect: 'Ampliar en seleccione',
+ zoomOnDeselect: 'Ampliar en no seleccione'
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Find/nls/fr/resource.js b/viewer/js/gis/dijit/Find/nls/fr/resource.js
new file mode 100644
index 000000000..63dfd8680
--- /dev/null
+++ b/viewer/js/gis/dijit/Find/nls/fr/resource.js
@@ -0,0 +1,25 @@
+define ({
+ selectQuery: 'Sélection',
+ searchText: {
+ label: 'Rechercher',
+ placeholder: 'Entrez le texte que vous souhaitez rechercher.'
+ },
+ exactMatches: 'Correspondances exactes seulement',
+ searchButton: {
+ label: 'Rechercher',
+ busyLabel: 'recherche'
+ },
+ clearButton: {
+ label: 'Effacer'
+ },
+ searching: 'Recherche...',
+ resultsLabel: {
+ multipleResultsSuffix: 's',
+ labelPrefix: 'Résultat',
+ labelSuffix: 'Trouvé'
+ },
+ noResultsLabel: 'Aucun résultat',
+ optionsLabel: 'Options',
+ zoomOnSelect: 'Zoom sur la sélection',
+ zoomOnDeselect: 'Zoom en desélectionnant'
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Find/nls/pt-br/resource.js b/viewer/js/gis/dijit/Find/nls/pt-br/resource.js
new file mode 100644
index 000000000..fa350b994
--- /dev/null
+++ b/viewer/js/gis/dijit/Find/nls/pt-br/resource.js
@@ -0,0 +1,26 @@
+// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html
+define({
+ selectQuery: 'Selecionar Procura',
+ searchText: {
+ label: 'Procurar por',
+ placeholder: 'Digite o texto que você quer procurar.'
+ },
+ exactMatches: 'Apenas buscas exatas',
+ searchButton: {
+ label: 'Procurar',
+ busyLabel: 'procurando'
+ },
+ clearButton: {
+ label: 'Limpar'
+ },
+ searching: 'Procurando...',
+ resultsLabel: {
+ multipleResultsSuffix: 's',
+ labelPrefix: 'Resultado',
+ labelSuffix: 'encontrado'
+ },
+ noResultsLabel: 'Nenhum Resultado Encontrado.',
+ optionsLabel: 'Opções',
+ zoomOnSelect: 'Zoom para selecionar',
+ zoomOnDeselect: 'Zoom para deselecionar'
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Find/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Find/nls/pt-pt/resource.js
new file mode 100644
index 000000000..e38f69d21
--- /dev/null
+++ b/viewer/js/gis/dijit/Find/nls/pt-pt/resource.js
@@ -0,0 +1,26 @@
+// http://dojotoolkit.org/reference-guide/1.10/dojo/i18n.html
+define({
+ selectQuery: 'Seleccionar consulta',
+ searchText: {
+ label: 'Procurar por',
+ placeholder: 'Introduza o texto que pretende procurar.'
+ },
+ exactMatches: 'Apenas correspondências exactas',
+ searchButton: {
+ label: 'Procurar',
+ busyLabel: 'a procurar'
+ },
+ clearButton: {
+ label: 'Limpar'
+ },
+ searching: 'A procurar...',
+ resultsLabel: {
+ multipleResultsSuffix: 's',
+ labelPrefix: 'Resultado',
+ labelSuffix: 'encontrado'
+ },
+ noResultsLabel: 'Nenhum resultado encontrado.',
+ optionsLabel: 'Opções',
+ zoomOnSelect: 'Aproximar ao seleccionar',
+ zoomOnDeselect: 'Aproximar ao desseleccionar'
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Find/nls/resource.js b/viewer/js/gis/dijit/Find/nls/resource.js
index 0d5c82f74..4e0a71f8d 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',
@@ -24,6 +24,10 @@ define({
optionsLabel: 'Options',
zoomOnSelect: 'Zoom on select',
zoomOnDeselect: 'Zoom on deselect'
- }
+ },
+ 'es': true,
+ 'fr': true,
+ 'pt-br': true,
+ 'pt-pt': true
});
diff --git a/viewer/js/gis/dijit/FloatingTitlePane.js b/viewer/js/gis/dijit/FloatingTitlePane.js
index 81a6c4820..6c9e05c16 100644
--- a/viewer/js/gis/dijit/FloatingTitlePane.js
+++ b/viewer/js/gis/dijit/FloatingTitlePane.js
@@ -6,6 +6,7 @@ define([
'dojo/dnd/Moveable',
'dojo/aspect',
'dojo/topic',
+ 'dojo/sniff',
'dojo/_base/window',
'dojo/window',
'dojo/dom-geometry',
@@ -16,7 +17,7 @@ define([
'dojox/layout/ResizeHandle',
'xstyle/css!dojox/layout/resources/ResizeHandle.css',
'xstyle/css!./FloatingTitlePane/css/FloatingTitlePane.css'
-], function (declare, TitlePane, on, lang, Moveable, aspect, topic, win, winUtils, domGeom, domStyle, domConstruct, domAttr, domClass, ResizeHandle) {
+], function (declare, TitlePane, on, lang, Moveable, aspect, topic, has, win, winUtils, domGeom, domStyle, domConstruct, domAttr, domClass, ResizeHandle) {
return declare([TitlePane], {
sidebarPosition: null,
@@ -35,6 +36,11 @@ define([
this.createDomNodes();
this.own(on(window, 'resize', lang.hitch(this, '_endDrag')));
}
+ if (this.iconClass) {
+ this.iconNode = domConstruct.create('span', {
+ 'class': 'titlePaneIcon fa fa-fw ' + this.iconClass
+ }, this.titleNode, 'before');
+ }
this.own(topic.subscribe('titlePane/event', lang.hitch(this, '_updateWidgetSidebarPosition')));
this.own(aspect.after(this, 'toggle', lang.hitch(this, '_afterToggle')));
this.inherited(arguments);
@@ -42,8 +48,16 @@ define([
startup: function () {
if (this.titleBarNode && this.canFloat) {
this._moveable = new Moveable(this.domNode, {
- handle: this.titleBarNode
+ handle: this.titleBarNode,
+ delay: this.dragDelay
});
+ if (this.dragDelay > 0) {
+ this._moveable.mover.prototype.onMouseUp = function (e) {
+ this.destroy();
+ e.preventDefault();
+ e.stopPropagation();
+ };
+ }
this._titleBarHeight = domStyle.get(this.titleBarNode, 'height');
aspect.after(this._moveable, 'onMove', lang.hitch(this, '_dragging'), true);
aspect.after(this._moveable, 'onMoveStop', lang.hitch(this, '_endDrag'), true);
@@ -100,12 +114,7 @@ define([
},
/* Methods for Dragging */
- _dragging: function (mover) {
- // add our own delay since the movable delay
- // property breaks in all versions of Internet Explorer
- if (Math.abs(mover.marginBox.l - this._moverBox.l) <= this.dragDelay || Math.abs(mover.marginBox.t - this._moverBox.t) <= this.dragDelay) {
- return;
- }
+ _dragging: function () {
this.isDragging = true;
if (!this.titleCursor) {
this.titleCursor = domStyle.get(this.titleBarNode, 'cursor');
diff --git a/viewer/js/gis/dijit/Geocoder/nls/es/resource.js b/viewer/js/gis/dijit/Geocoder/nls/es/resource.js
new file mode 100644
index 000000000..edd0ec207
--- /dev/null
+++ b/viewer/js/gis/dijit/Geocoder/nls/es/resource.js
@@ -0,0 +1,14 @@
+define ({
+ title: 'Alternar barra de búsqueda',
+ labels: {
+ address: 'Dirección',
+ neighborhood: 'Barrio',
+ city: 'Ciudad',
+ subregion: 'Subregión',
+ region: 'Región',
+ postalCode: 'Código postal',
+ countryCode: 'Código de país',
+ locatorName: 'Nombre del localizador',
+ getAddressHere: 'Obtener dirección aquí'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Geocoder/nls/fr/resource.js b/viewer/js/gis/dijit/Geocoder/nls/fr/resource.js
new file mode 100644
index 000000000..8d4e233f8
--- /dev/null
+++ b/viewer/js/gis/dijit/Geocoder/nls/fr/resource.js
@@ -0,0 +1,14 @@
+define ({
+ title: 'Activer/désactiver la barre de recherche',
+ labels: {
+ address: 'Adresse',
+ neighborhood: 'Quartier',
+ city: 'Ville',
+ subregion: 'Sous-région',
+ region: 'Région',
+ postalCode: 'Code postal',
+ countryCode: 'Code de pays',
+ locatorName: 'Nom du localisateur',
+ getAddressHere: 'Obtenir l\'adresse ici'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Geocoder/nls/pt-br/resource.js b/viewer/js/gis/dijit/Geocoder/nls/pt-br/resource.js
new file mode 100644
index 000000000..8f79694a2
--- /dev/null
+++ b/viewer/js/gis/dijit/Geocoder/nls/pt-br/resource.js
@@ -0,0 +1,14 @@
+define ({
+ title: 'Alternar barra de Pesquisa',
+ labels: {
+ address: 'Endereço',
+ neighborhood: 'Bairro',
+ city: 'Cidade',
+ subregion: 'Subregião',
+ region: 'Região',
+ postalCode: 'Código Postal (CEP)',
+ countryCode: 'Código do País',
+ locatorName: 'Nome do Localizador',
+ getAddressHere: 'Obtenha o Endereço daqui'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Geocoder/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Geocoder/nls/pt-pt/resource.js
new file mode 100644
index 000000000..7667ddf08
--- /dev/null
+++ b/viewer/js/gis/dijit/Geocoder/nls/pt-pt/resource.js
@@ -0,0 +1,14 @@
+define({
+ title: 'Alternar barra de pesquisa',
+ labels: {
+ address: 'Endereço',
+ neighborhood: 'Bairro',
+ city: 'Cidade',
+ subregion: 'Subregião',
+ region: 'Região',
+ postalCode: 'Código postal',
+ countryCode: 'Código do país',
+ locatorName: 'Nome do localizador',
+ getAddressHere: 'Obter o endereço daqui'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Geocoder/nls/resource.js b/viewer/js/gis/dijit/Geocoder/nls/resource.js
index 5f02f504a..a93722458 100644
--- a/viewer/js/gis/dijit/Geocoder/nls/resource.js
+++ b/viewer/js/gis/dijit/Geocoder/nls/resource.js
@@ -12,5 +12,9 @@ define ({
locatorName: 'Locator name',
getAddressHere: 'Get address here'
}
- }
+ },
+ 'es': true,
+ 'fr': true,
+ 'pt-br': true,
+ 'pt-pt': true
});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Help.js b/viewer/js/gis/dijit/Help.js
index 2594baf0c..461a374d1 100644
--- a/viewer/js/gis/dijit/Help.js
+++ b/viewer/js/gis/dijit/Help.js
@@ -9,17 +9,18 @@ define([
'dojo/_base/lang',
'dojo/aspect',
'dojo/text!./Help/templates/HelpDialog.html',
+ 'dojo/i18n!./Help/nls/resource',
'dijit/form/Button',
'dijit/layout/TabContainer',
'dijit/layout/ContentPane',
'xstyle/css!./Help/css/Help.css'
-], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _FloatingWidgetMixin, domConstruct, on, lang, aspect, template) {
+], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _FloatingWidgetMixin, domConstruct, on, lang, aspect, template, i18n) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _FloatingWidgetMixin], {
widgetsInTemplate: true,
templateString: template,
- title: 'Help',
- html: 'Help',
+ i18n: i18n,
+ html: 'link'.replace('link', i18n.link),
domTarget: 'helpDijit',
draggable: false,
baseClass: 'helpDijit',
diff --git a/viewer/js/gis/dijit/Help/nls/es/resource.js b/viewer/js/gis/dijit/Help/nls/es/resource.js
new file mode 100644
index 000000000..6c4cea412
--- /dev/null
+++ b/viewer/js/gis/dijit/Help/nls/es/resource.js
@@ -0,0 +1,36 @@
+define ({
+ link: 'Ayuda',
+ navigation: {
+ title: 'Navegación',
+ description: 'Mapa de navegación a través del ratón y el teclado:',
+ pan1: 'Arrastre a la sartén',
+ recenter: 'SHIFT + Clic para volver a centrar',
+ zoomIn1: 'SHIFT + Arrastre para ampliar la imagen',
+ zoomOut1: 'SHIFT + CTRL + arrastrar para alejarla',
+ zoomIn2: 'De desplazamiento del ratón hacia adelante para hacer un zoom',
+ zoomOut2: 'De desplazamiento del ratón hacia atrás para reducir',
+ pan2: 'Utilice las teclas de flecha para desplazarse',
+ zoomInLevel: '+ clave para hacer un zoom un nivel',
+ zoomOutLevel: '- clave para alejar un nivel',
+ zoomCenter: 'Doble click para Centro y hacer zoom in'
+ },
+ search: {
+ title: 'Buscar',
+ description: 'Una variedad de búsquedas se pueden realizar en el buscador:',
+ address: 'Buscar por Dirección',
+ place: 'Búsqueda Territorial',
+ etc: 'Buscar por código postal, condado, etc.'
+ },
+ tools: {
+ title: 'Herramientas',
+ description: 'Además de las capacidades de búsqueda, se proporcionan las siguientes herramientas:',
+ measure: {
+ title: 'Medición',
+ description: 'La herramienta de medida proporciona la capacidad para dibujar un punto, una línea o un polígono en el mapa y especificar la unidad de medida.'
+ },
+ print: {
+ title: 'Impresión',
+ description: 'Este mapa se puede exportar a diversos formatos y diseños.'
+ }
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Help/nls/fr/resource.js b/viewer/js/gis/dijit/Help/nls/fr/resource.js
new file mode 100644
index 000000000..6bda3e07f
--- /dev/null
+++ b/viewer/js/gis/dijit/Help/nls/fr/resource.js
@@ -0,0 +1,36 @@
+define ({
+ link: 'Aide',
+ navigation: {
+ title: 'Navigation',
+ description: 'Navigation dans la carte en utilisant la souris et le clavier:',
+ pan1: 'Clic + Glisser pour déplacer la carte',
+ recenter: 'SHIFT + Clic pour recentrer',
+ zoomIn1: 'SHIFT + Sélection pour agrandir',
+ zoomOut1: 'SHIFT + CTRL + glisser pour effectuer un zoom arrière',
+ zoomIn2: 'Roulette de la souris vers l\'avant pour agrandir',
+ zoomOut2: 'Roulette de la souris vers l\'avant pour rétrécir',
+ pan2: 'Utilisez les flèches pour vous déplacer',
+ zoomInLevel: '+ pour zoomer un niveau',
+ zoomOutLevel: '- pour rétrécir un niveau',
+ zoomCenter: 'Double cliquez pour centrer et agrandir'
+ },
+ search: {
+ title: 'Recherche',
+ description: 'Une variété de recherches peuvent être effectuées dans la zone de recherche:',
+ address: 'Recherche par adresse',
+ place: 'Recherche par nom de lieu',
+ etc: 'Recherche par code postal, région, etc.'
+ },
+ tools: {
+ title: 'Outils',
+ description: 'En plus des capacités de recherche, les outils suivants sont fournis:',
+ measure: {
+ title: 'Mesurer',
+ description: 'L\'outil de mesure fournit les capacités pour dessiner un point, une ligne ou un polygone sur la carte et indiquer l\'unité de mesure.'
+ },
+ print: {
+ title: 'Impression',
+ description: 'Cette carte peut être exportée vers différents formats et mises en page.'
+ }
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Help/nls/pt-br/resource.js b/viewer/js/gis/dijit/Help/nls/pt-br/resource.js
new file mode 100644
index 000000000..2793d85a8
--- /dev/null
+++ b/viewer/js/gis/dijit/Help/nls/pt-br/resource.js
@@ -0,0 +1,36 @@
+define({
+ link: 'Ajuda',
+ navigation: {
+ title: 'Navegação',
+ description: 'Navegação no mapa usando o rato e o teclado',
+ pan1: 'Arrastar para mover',
+ recenter: 'SHIFT + Clique para centrar',
+ zoomIn1: 'SHIFT + Arrastar para aproximar à área',
+ zoomOut1: 'SHIFT + CTRL + Arrastar para afastar',
+ zoomIn2: 'Mover roda de deslocação do rato para a frente para aproximar',
+ zoomOut2: 'Mover roda de deslocação do rato para trás para afastar',
+ pan2: 'Teclas de seta para mover',
+ zoomInLevel: 'Tecla + para aproximar um nível',
+ zoomOutLevel: 'Tecla - para afastar um nível',
+ zoomCenter: 'Duplo clique para centrar e aproximar'
+ },
+ search: {
+ title: 'Pesquisa',
+ description: 'A caixa de pesquisa suporta vários tipos de pesquisa:',
+ address: 'Pesquisar por endereço',
+ place: 'Pesquisar por nome do local',
+ etc: 'Pesquisar por código postal, região, etc.'
+ },
+ tools: {
+ title: 'Ferramentas',
+ description: 'Além das funcionalidades de pesquisa, são incluídas as seguintes ferramentas:',
+ measure: {
+ title: 'Medir',
+ description: 'A ferramenta de medição permite desenhar um ponto, linha, ou polígono, no mapa e especificar a unidade de medida.'
+ },
+ print: {
+ title: 'Imprimir',
+ description: 'Este mapa pode ser exportado para diferentes formatos e modelos.'
+ }
+ }
+});
diff --git a/viewer/js/gis/dijit/Help/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Help/nls/pt-pt/resource.js
new file mode 100644
index 000000000..2793d85a8
--- /dev/null
+++ b/viewer/js/gis/dijit/Help/nls/pt-pt/resource.js
@@ -0,0 +1,36 @@
+define({
+ link: 'Ajuda',
+ navigation: {
+ title: 'Navegação',
+ description: 'Navegação no mapa usando o rato e o teclado',
+ pan1: 'Arrastar para mover',
+ recenter: 'SHIFT + Clique para centrar',
+ zoomIn1: 'SHIFT + Arrastar para aproximar à área',
+ zoomOut1: 'SHIFT + CTRL + Arrastar para afastar',
+ zoomIn2: 'Mover roda de deslocação do rato para a frente para aproximar',
+ zoomOut2: 'Mover roda de deslocação do rato para trás para afastar',
+ pan2: 'Teclas de seta para mover',
+ zoomInLevel: 'Tecla + para aproximar um nível',
+ zoomOutLevel: 'Tecla - para afastar um nível',
+ zoomCenter: 'Duplo clique para centrar e aproximar'
+ },
+ search: {
+ title: 'Pesquisa',
+ description: 'A caixa de pesquisa suporta vários tipos de pesquisa:',
+ address: 'Pesquisar por endereço',
+ place: 'Pesquisar por nome do local',
+ etc: 'Pesquisar por código postal, região, etc.'
+ },
+ tools: {
+ title: 'Ferramentas',
+ description: 'Além das funcionalidades de pesquisa, são incluídas as seguintes ferramentas:',
+ measure: {
+ title: 'Medir',
+ description: 'A ferramenta de medição permite desenhar um ponto, linha, ou polígono, no mapa e especificar a unidade de medida.'
+ },
+ print: {
+ title: 'Imprimir',
+ description: 'Este mapa pode ser exportado para diferentes formatos e modelos.'
+ }
+ }
+});
diff --git a/viewer/js/gis/dijit/Help/nls/resource.js b/viewer/js/gis/dijit/Help/nls/resource.js
new file mode 100644
index 000000000..137c491ff
--- /dev/null
+++ b/viewer/js/gis/dijit/Help/nls/resource.js
@@ -0,0 +1,42 @@
+define({
+ root: {
+ link: 'Help',
+ navigation: {
+ title: 'Navigation',
+ description: 'Map navigation using mouse and keyboard:',
+ pan1: 'Drag to pan',
+ recenter: 'SHIFT + Click to recenter',
+ zoomIn1: 'SHIFT + Drag to zoom in',
+ zoomOut1: 'SHIFT + CTRL + Drag to zoom out',
+ zoomIn2: 'Mouse Scroll Forward to zoom in',
+ zoomOut2: 'Mouse Scroll Backward to zoom out',
+ pan2: 'Use Arrow keys to pan',
+ zoomInLevel: '+ key to zoom in a level',
+ zoomOutLevel: '- key to zoom out a level',
+ zoomCenter: 'Double Click to Center and Zoom in'
+ },
+ search: {
+ title: 'Search',
+ description: 'A variety of searches can be performed in the search box:',
+ address: 'Search by Address',
+ place: 'Search by Place Name',
+ etc: 'Search By Zip Code, County, etc.'
+ },
+ tools: {
+ title: 'Tools',
+ description: 'In addition to Search capabilities, the following tools are provided:',
+ measure: {
+ title: 'Measure',
+ description: 'The measure tool provides the capabilities to draw a point, line, or polygon on the map and specify the unit of measurement.'
+ },
+ print: {
+ title: 'Print',
+ description: 'This map can be exported to various formats and layouts.'
+ }
+ }
+ },
+ 'es': true,
+ 'fr': true,
+ 'pt-br': true,
+ 'pt-pt': true
+});
diff --git a/viewer/js/gis/dijit/Help/templates/HelpDialog.html b/viewer/js/gis/dijit/Help/templates/HelpDialog.html
index 82a31e5b9..da701f42f 100644
--- a/viewer/js/gis/dijit/Help/templates/HelpDialog.html
+++ b/viewer/js/gis/dijit/Help/templates/HelpDialog.html
@@ -2,42 +2,42 @@
-
+
- Map navigation using mouse and keyboard:
+ ${i18n.navigation.description}
- Drag to pan
+ ${i18n.navigation.pan1}
- SHIFT + Click to recenter
+ ${i18n.navigation.recenter}
- SHIFT + Drag to zoom in
+ ${i18n.navigation.zoomIn1}
- SHIFT + CTRL + Drag to zoom out
+ ${i18n.navigation.zoomOut1}
- Mouse Scroll Forward to zoom in
+ ${i18n.navigation.zoomIn2}
- Mouse Scroll Backward to zoom out
+ ${i18n.navigation.zoomOut2}
- Use Arrow keys to pan
+ ${i18n.navigation.pan2}
- + key to zoom in a level
+ ${i18n.navigation.zoomInLevel}
- - key to zoom out a level
+ ${i18n.navigation.zoomOutLevel}
- Double Click to Center and Zoom in
+ ${i18n.navigation.zoomCenter}
@@ -45,35 +45,34 @@
-
- A variety of searches can be performed in the search box:
+
+ ${i18n.search.description}
- Search by Address
+ ${i18n.search.address}
- Search by Place Name
+ ${i18n.search.place}
- Search By Zip Code, County, etc.
+ ${i18n.search.etc}
-
- In addition to Search capabilities, the following tools are provided:
+
+ ${i18n.tools.description}
- Measure
+ ${i18n.tools.measure.title}
- The measure tool provides the capabilities to draw a point, line, or polygon
- on the map and specify the unit of measurement.
+ ${i18n.tools.measure.description}
- Print
+ ${i18n.tools.print.title}
- This map can be exported to varouis formats and layouts
+ ${i18n.tools.print.description}
diff --git a/viewer/js/gis/dijit/Identify.js b/viewer/js/gis/dijit/Identify.js
index dc91afac5..ccae23bc5 100644
--- a/viewer/js/gis/dijit/Identify.js
+++ b/viewer/js/gis/dijit/Identify.js
@@ -16,13 +16,17 @@ define([
'esri/tasks/IdentifyTask',
'esri/tasks/IdentifyParameters',
'esri/dijit/PopupTemplate',
+ 'esri/layers/FeatureLayer',
+ 'esri/TimeExtent',
+ 'dojo/Deferred',
'dojo/text!./Identify/templates/Identify.html',
'dojo/i18n!./Identify/nls/resource',
+ './Identify/Formatters',
'dijit/form/Form',
'dijit/form/FilteringSelect',
'xstyle/css!./Identify/css/Identify.css'
-], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, MenuItem, lang, array, all, topic, query, domStyle, domClass, Moveable, Memory, IdentifyTask, IdentifyParameters, PopupTemplate, IdentifyTemplate, i18n) {
+], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, MenuItem, lang, array, all, topic, query, domStyle, domClass, Moveable, Memory, IdentifyTask, IdentifyParameters, PopupTemplate, FeatureLayer, TimeExtent, Deferred, IdentifyTemplate, i18n, Formatters) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
widgetsInTemplate: true,
@@ -33,6 +37,7 @@ define([
mapClickMode: null,
identifies: {},
infoTemplates: {},
+ featureLayers: {},
ignoreOtherGraphics: true,
createDefaultInfoTemplates: true,
draggable: false,
@@ -44,6 +49,19 @@ define([
'shape_len', 'shape.stlength()',
'shape.area', 'shape_area', 'shape.starea()'
],
+ /**
+ * field type mappings to their default formatter functions
+ * overriding this object will globally replace the default
+ * formatter function for the field type
+ * @type {Object}
+ */
+ defaultFormatters: {
+ 'esriFieldTypeSmallInteger': Formatters.formatInt,
+ 'esriFieldTypeInteger': Formatters.formatInt,
+ 'esriFieldTypeSingle': Formatters.formatFloat,
+ 'esriFieldTypeDouble': Formatters.formatFloat,
+ 'esriFieldTypeDate': Formatters.formatDate
+ },
postCreate: function () {
this.inherited(arguments);
@@ -51,56 +69,10 @@ define([
this.identifies = {};
}
this.layers = [];
- array.forEach(this.layerInfos, function (layerInfo) {
- var lyrId = layerInfo.layer.id;
- var layer = this.map.getLayer(lyrId);
- if (layer) {
- var url = layer.url;
-
- // handle feature layers
- if (layer.declaredClass === 'esri.layers.FeatureLayer') {
-
- // If is a feature layer that does not support
- // Identify (Feature Service), create an
- // infoTemplate for the graphic features. Create
- // it only if one does not already exist.
- if (layer.capabilities && array.indexOf(layer.capabilities.toLowerCase(), 'data') < 0) {
- if (!layer.infoTemplate) {
- var infoTemplate = this.getInfoTemplate(layer, layer.layerId);
- if (infoTemplate) {
- layer.setInfoTemplate(infoTemplate);
- return;
- }
- }
- }
-
- // If it is a feature Layer, we get the base url
- // for the map service by removing the layerId.
- var lastSL = url.lastIndexOf('/' + layer.layerId);
- if (lastSL > 0) {
- url = url.substring(0, lastSL);
- }
- }
-
- this.layers.push({
- ref: layer,
- layerInfo: layerInfo,
- identifyTask: new IdentifyTask(url)
- });
-
- // rebuild the layer selection list when any layer is hidden
- // but only if we have a UI
- if (this.parentWidget) {
- layer.on('visibility-change', lang.hitch(this, function (evt) {
- if (evt.visible === false) {
- this.createIdentifyLayerList();
- }
- }));
- }
- }
- }, this);
+ this.addLayerInfos(this.layerInfos);
this.own(topic.subscribe('mapClickMode/currentSet', lang.hitch(this, 'setMapClickMode')));
+ this.own(topic.subscribe('identify/addLayerInfos', lang.hitch(this, 'addLayerInfos')));
this.map.on('click', lang.hitch(this, function (evt) {
if (this.mapClickMode === 'identify') {
@@ -124,6 +96,80 @@ define([
this.setupDraggable();
}
},
+ /**
+ * handles an array of layerInfos to call addLayerInfo for each layerInfo
+ * @param {Array} layerInfos The array of layer infos
+ * @returns {undefined}
+ */
+ addLayerInfos: function (layerInfos) {
+ array.forEach(layerInfos, lang.hitch(this, 'addLayerInfo'));
+ },
+ /**
+ * Initializes an infoTemplate on a layerInfo.layer object if it doesn't
+ * exist already.
+ * @param {object} layerInfo A cmv layerInfo object that contains a layer property
+ * @return {undefined}
+ */
+ addLayerInfo: function (layerInfo) {
+ var lyrId = layerInfo.layer.id, layer = this.map.getLayer(lyrId), infoTemplate;
+ if (layer) {
+ var url = layer.url;
+
+ // handle feature layers
+ if (layer.declaredClass === 'esri.layers.FeatureLayer') {
+
+ // If is a feature layer that does not support
+ // Identify (Feature Service), create an
+ // infoTemplate for the graphic features. Create
+ // it only if one does not already exist.
+ if (layer.capabilities && array.indexOf(layer.capabilities.toLowerCase(), 'data') < 0) {
+ if (!layer.infoTemplate) {
+ infoTemplate = this.getInfoTemplate(layer, layer.layerId);
+ if (infoTemplate) {
+ layer.setInfoTemplate(infoTemplate);
+ var fieldInfos = infoTemplate.info.fieldInfos;
+ var formatters = array.filter(fieldInfos, function (info) {
+ return (info.formatter);
+ });
+ if (formatters.length > 0) {
+ layer.on('graphic-draw', lang.hitch(this, 'getFormattedFeature', layer.infoTemplate));
+ }
+ }
+ }
+ }
+
+ // If it is a feature Layer, we get the base url
+ // for the map service by removing the layerId.
+ var lastSL = url.lastIndexOf('/' + layer.layerId);
+ if (lastSL > 0) {
+ url = url.substring(0, lastSL);
+ }
+ } else if (layer.layerInfos) {
+ array.forEach(layer.layerInfos, lang.hitch(this, function (subLayerInfo) {
+ var subLayerId = subLayerInfo.id;
+ if ((layerInfo.layerIds === null) || (array.indexOf(layerInfo.layerIds, subLayerId) >= 0)) {
+ this.getFeatureLayerForDynamicSublayer(layer, subLayerId);
+ }
+ }));
+ }
+
+ this.layers.push({
+ ref: layer,
+ layerInfo: layerInfo,
+ identifyTask: new IdentifyTask(url)
+ });
+
+ // rebuild the layer selection list when any layer is hidden
+ // but only if we have a UI
+ if (this.parentWidget) {
+ layer.on('visibility-change', lang.hitch(this, function (evt) {
+ if (evt.visible === false) {
+ this.createIdentifyLayerList();
+ }
+ }));
+ }
+ }
+ },
addRightClickMenu: function () {
this.map.on('MouseDown', lang.hitch(this, function (evt) {
this.mapRightClick = evt;
@@ -157,8 +203,27 @@ define([
}
},
executeIdentifyTask: function (evt) {
+
+
+ var mapPoint = evt.mapPoint;
+ var identifyParams = this.createIdentifyParams(mapPoint);
+ var identifies = [];
+ var identifiedlayers = [];
+ var selectedLayer = this.getSelectedLayer();
+
+
if (!this.checkForGraphicInfoTemplate(evt)) {
- return;
+ // return;
+ var layer = array.filter(this.layers, function (l) {
+ return l.ref.id === evt.graphic._layer.id;
+ })[0];
+ if (!layer) {
+ return;
+ }
+ identifiedlayers.push(layer);
+ var d = new Deferred();
+ identifies.push(d.promise);
+ d.resolve([{feature: evt.graphic}]);
}
this.map.infoWindow.hide();
@@ -169,20 +234,18 @@ define([
return;
}
- var mapPoint = evt.mapPoint;
- var identifyParams = this.createIdentifyParams(mapPoint);
- var identifies = [];
- var identifiedlayers = [];
- var selectedLayer = this.getSelectedLayer();
- array.forEach(this.layers, lang.hitch(this, function (layer) {
- var layerIds = this.getLayerIds(layer, selectedLayer);
+ array.forEach(this.layers, lang.hitch(this, function (lyr) {
+ var layerIds = this.getLayerIds(lyr, selectedLayer);
if (layerIds.length > 0) {
var params = lang.clone(identifyParams);
- params.layerDefinitions = layer.ref.layerDefinitions;
+ params.layerDefinitions = lyr.ref.layerDefinitions;
params.layerIds = layerIds;
- identifies.push(layer.identifyTask.execute(params));
- identifiedlayers.push(layer);
+ if (lyr.ref.timeInfo && lyr.ref.timeInfo.timeExtent && this.map.timeExtent) {
+ params.timeExtent = new TimeExtent(this.map.timeExtent.startTime, this.map.timeExtent.endTime);
+ }
+ identifies.push(lyr.identifyTask.execute(params));
+ identifiedlayers.push(lyr);
}
}));
@@ -293,16 +356,33 @@ define([
if (result.feature.infoTemplate === undefined) {
var infoTemplate = this.getInfoTemplate(ref, null, result);
if (infoTemplate) {
+ if (result.layerId && ref.layerInfos && infoTemplate.info.showAttachments) {
+ result.feature._layer = this.getFeatureLayerForDynamicSublayer(ref, result.layerId);
+ }
result.feature.setInfoTemplate(infoTemplate);
} else {
return;
}
}
- fSet.push(result.feature);
+ var feature = this.getFormattedFeature(result.feature.infoTemplate, result.feature);
+ fSet.push(feature);
}, this);
}, this);
this.map.infoWindow.setFeatures(fSet);
},
+ getFormattedFeature: function (infoTemplate, feature) {
+ if (feature.graphic) {
+ feature = feature.graphic;
+ }
+ if (feature && infoTemplate && infoTemplate.info) {
+ array.forEach(infoTemplate.info.fieldInfos, function (info) {
+ if (typeof info.formatter === 'function') {
+ feature.attributes[info.fieldName] = info.formatter(feature.attributes[info.fieldName], feature.attributes, lang.clone(feature.geometry));
+ }
+ });
+ }
+ return feature;
+ },
identifyError: function (err) {
this.map.infoWindow.hide();
topic.publish('viewer/handleError', {
@@ -315,43 +395,41 @@ define([
},
getInfoTemplate: function (layer, layerId, result) {
- var popup = null,
- content = null;
+ var popup, config;
if (result) {
- layerId = result.layerId;
+ layerId = result.layerId || layer.layerId;
} else if (layerId === null) {
layerId = layer.layerId;
}
- // see if we have a Popup config defined for this layer
- if (this.identifies.hasOwnProperty(layer.id)) {
- if (this.identifies[layer.id].hasOwnProperty(layerId)) {
- popup = this.identifies[layer.id][layerId];
- if (popup) {
- if (typeof (popup.declaredClass) !== 'string') { // has it been created already?
- if (popup.content) {
- content = popup.content;
- }
- popup = new PopupTemplate(popup);
- if (content) {
- popup.setContent(content);
- }
- this.identifies[layer.id][layerId] = popup;
- }
+ var ids = this.identifies;
+ if (ids.hasOwnProperty(layer.id)) {
+ if (ids[layer.id].hasOwnProperty(layerId)) {
+ popup = ids[layer.id][layerId];
+ if (popup instanceof PopupTemplate) {
+ return popup;
}
}
+ } else {
+ ids[layer.id] = {};
}
- // if no Popup config found, create one with all attributes or layer fields
- if (!popup) {
- popup = this.createDefaultInfoTemplate(layer, layerId, result);
+ // by mixin in the users config with the default props we can
+ // generate a config object that provides the basics automatically
+ // while letting the user override only the parts they want...like mediaInfos
+ config = lang.mixin(this.createDefaultInfoTemplate(layer, layerId, result), ids[layer.id][layerId] || {});
+
+ popup = ids[layer.id][layerId] = new PopupTemplate(config);
+ if (config.content) {
+ popup.setContent(config.content);
}
- return popup;
+ return ids[layer.id][layerId];
},
createDefaultInfoTemplate: function (layer, layerId, result) {
- var popup = null, fieldInfos = [];
+ var popup = null,
+ fieldInfos = [];
var layerName = this.getLayerName(layer);
if (result) {
@@ -366,14 +444,14 @@ define([
if (attributes.hasOwnProperty(prop)) {
this.addDefaultFieldInfo(fieldInfos, {
fieldName: prop,
- label: prop.replace(/_/g, ' '),
+ label: this.makeSentenceCase(prop),
visible: true
});
}
}
}
- // from the outFields of the layer
+ // from the outFields of the layer
} else if (layer._outFields && (layer._outFields.length) && (layer._outFields[0] !== '*')) {
var fields = layer.fields;
@@ -390,32 +468,44 @@ define([
}
}));
- // from the fields layer
+ // from the fields layer
} else if (layer.fields) {
array.forEach(layer.fields, lang.hitch(this, function (field) {
this.addDefaultFieldInfo(fieldInfos, {
fieldName: field.name,
- label: field.alias,
+ label: field.alias === field.name ? this.makeSentenceCase(field.name) : field.alias,
visible: true
});
}));
}
if (fieldInfos.length > 0) {
- popup = new PopupTemplate({
+ popup = {
title: layerName,
fieldInfos: fieldInfos,
showAttachments: (layer.hasAttachments)
- });
- if (!this.identifies[layer.id]) {
- this.identifies[layer.id] = {};
- }
- this.identifies[layer.id][layerId] = popup;
+ };
}
return popup;
},
+ /**
+ * converts a string to a nice sentence case format
+ * @url http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript
+ * @param {string} str The string to convert
+ * @return {string} The converted string
+ */
+ makeSentenceCase: function (str) {
+ if (!str.length) {
+ return '';
+ }
+ str = str.toLowerCase().replace(/_/g, ' ').split(' ');
+ for (var i = 0; i < str.length; i++) {
+ str[i] = str[i].charAt(0).toUpperCase() + (str[i].substr(1).length ? str[i].substr(1) : '');
+ }
+ return (str.length ? str.join(' ') : str);
+ },
addDefaultFieldInfo: function (fieldInfos, field) {
var nameLC = field.fieldName.toLowerCase();
@@ -489,8 +579,10 @@ define([
if (layerInfo.subLayerIds !== null) {
return false;
}
- // only include sublayers that are currently visible
- if (array.indexOf(ref.visibleLayers, layerInfo.id) < 0) {
+
+ if (this.isDefaultLayerVisibility(ref) && !this.checkVisibilityRecursive(ref, layerInfo.id)) {
+ return false;
+ } else if (array.indexOf(ref.visibleLayers, layerInfo.id) < 0) {
return false;
}
// only include sublayers that are within the current map scale
@@ -518,6 +610,44 @@ define([
return true;
},
+ /**
+ * recursively check all a layer's parent(s) layers for visibility
+ * this only needs to be done if the layers visibleLayers array is
+ * set to the default visibleLayers. After setVisibleLayers
+ * is called the first time group layers are NOT included.
+ * @param {esri/layers/DynamicMapServiceLayer} layer The layer reference
+ * @param {Integer} id The sublayer id to check for visibility
+ * @return {Boolean} Whether or not the sublayer is visible based on its parent(s) visibility
+ */
+ checkVisibilityRecursive: function (layer, id) {
+ var layerInfos = array.filter(layer.layerInfos, function (layerInfo) {
+ return (layerInfo.id === id);
+ });
+ if (layerInfos.length > 0) {
+ var info = layerInfos[0];
+ if (layer.visibleLayers.indexOf(id) !== -1 &&
+ (info.parentLayerId === -1 || this.checkVisibilityRecursive(layer, info.parentLayerId))) {
+ return true;
+ }
+ }
+ return false;
+ },
+ /**
+ * check each defaultVisibility and if its not in the visibleLayers
+ * array, then the layer has non-default layer visibility
+ * @param {esri/layers/DynamicMapServiceLayer} layer The layer reference
+ * @return {Boolean} Whether or not we're operating with the default visibleLayers array or not
+ */
+ isDefaultLayerVisibility: function (layer) {
+ for (var i = 0; i < layer.layerInfos.length; i++) {
+ var item = layer.layerInfos[i];
+ if (item.defaultVisibility && layer.visibleLayers.indexOf(item.id) === -1) {
+ return false;
+ }
+ }
+ return true;
+ },
+
getLayerName: function (layer) {
var name = null;
if (layer.layerInfo) {
@@ -540,6 +670,17 @@ define([
return name;
},
+ getFeatureLayerForDynamicSublayer: function (layer, layerId) {
+ if (!layer.layerInfos) {
+ return false;
+ }
+ var key = layer.url + '/' + layerId;
+ if (!this.featureLayers.hasOwnProperty(key)) {
+ this.featureLayers[key] = new FeatureLayer(key);
+ }
+ return this.featureLayers[key];
+ },
+
layerVisibleAtCurrentScale: function (layer) {
var mapScale = this.map.getScale();
return !(((layer.maxScale !== 0 && mapScale < layer.maxScale) || (layer.minScale !== 0 && mapScale > layer.minScale)));
@@ -567,4 +708,4 @@ define([
}, this);
}
});
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/Identify/Formatters.js b/viewer/js/gis/dijit/Identify/Formatters.js
new file mode 100644
index 000000000..b7c259e9d
--- /dev/null
+++ b/viewer/js/gis/dijit/Identify/Formatters.js
@@ -0,0 +1,21 @@
+define([
+ 'dojo/number',
+ 'dojo/date/locale'
+], function (number, locale) {
+ return {
+ formatInt: function (value) {
+ return number.format(value);
+ },
+ formatFloat: function (value) {
+ return number.format(value, {
+ places: 3
+ });
+ },
+ formatDate: function (value) {
+ var date = new Date(value);
+ return locale.format(date, {
+ formatLength: 'short'
+ });
+ }
+ };
+});
diff --git a/viewer/js/gis/dijit/Identify/nls/es/resource.js b/viewer/js/gis/dijit/Identify/nls/es/resource.js
new file mode 100644
index 000000000..fda941704
--- /dev/null
+++ b/viewer/js/gis/dijit/Identify/nls/es/resource.js
@@ -0,0 +1,12 @@
+define ({
+ labels: {
+ selectLayer: 'Seleccione la opción "Todas las capas visibles" o una sola capa para identificar:',
+ allVisibleLayers: '*** Todas las capas visibles ***'
+ },
+ rightClickMenuItem: {
+ label: 'Identificar aquí'
+ },
+ mapInfoWindow: {
+ identifyingTitle: 'Identificando...'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Identify/nls/fr/resource.js b/viewer/js/gis/dijit/Identify/nls/fr/resource.js
new file mode 100644
index 000000000..013c39962
--- /dev/null
+++ b/viewer/js/gis/dijit/Identify/nls/fr/resource.js
@@ -0,0 +1,12 @@
+define ({
+ labels: {
+ selectLayer: 'Choisissez "Tous les calques visibles" ou une seule couche pour identifier:',
+ allVisibleLayers: '*** Tous les calques visibles ***'
+ },
+ rightClickMenuItem: {
+ label: 'Identifier ici'
+ },
+ mapInfoWindow: {
+ identifyingTitle: 'Identification...'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Identify/nls/pt-br/resource.js b/viewer/js/gis/dijit/Identify/nls/pt-br/resource.js
new file mode 100644
index 000000000..1a4d3327b
--- /dev/null
+++ b/viewer/js/gis/dijit/Identify/nls/pt-br/resource.js
@@ -0,0 +1,12 @@
+define({
+ labels: {
+ selectLayer: 'Escolha "Todas Camadas Visíveis" ou uma camada única para Identificar:',
+ allVisibleLayers: '*** Todas Camadas Visíveis ***'
+ },
+ rightClickMenuItem: {
+ label: 'Identifique aqui'
+ },
+ mapInfoWindow: {
+ identifyingTitle: 'Identificando...'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Identify/nls/pt-pt/resource.js b/viewer/js/gis/dijit/Identify/nls/pt-pt/resource.js
new file mode 100644
index 000000000..ab2998ff7
--- /dev/null
+++ b/viewer/js/gis/dijit/Identify/nls/pt-pt/resource.js
@@ -0,0 +1,12 @@
+define({
+ labels: {
+ selectLayer: 'Escolher "Todas as camadas visíveis" ou uma única camada para identificar:',
+ allVisibleLayers: '*** Todas as camadas visíveis ***'
+ },
+ rightClickMenuItem: {
+ label: 'Identificar aqui'
+ },
+ mapInfoWindow: {
+ identifyingTitle: 'A identificar...'
+ }
+});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/Identify/nls/resource.js b/viewer/js/gis/dijit/Identify/nls/resource.js
index 54093328c..f46111906 100644
--- a/viewer/js/gis/dijit/Identify/nls/resource.js
+++ b/viewer/js/gis/dijit/Identify/nls/resource.js
@@ -10,5 +10,9 @@ define ({
mapInfoWindow: {
identifyingTitle: 'Identifying...'
}
- }
+ },
+ 'es': true,
+ 'fr': true,
+ 'pt-br': true,
+ 'pt-pt': true
});
\ No newline at end of file
diff --git a/viewer/js/gis/dijit/LayerControl.js b/viewer/js/gis/dijit/LayerControl.js
index a47cb8c5b..4a8f14098 100644
--- a/viewer/js/gis/dijit/LayerControl.js
+++ b/viewer/js/gis/dijit/LayerControl.js
@@ -33,8 +33,8 @@ define([
map: null,
layerInfos: [],
icons: {
- expand: 'fa-plus-square-o',
- collapse: 'fa-minus-square-o',
+ expand: 'fa-caret-right',
+ collapse: 'fa-caret-down',
checked: 'fa-check-square-o',
unchecked: 'fa-square-o',
update: 'fa-refresh',
@@ -51,6 +51,7 @@ define([
noLegend: null,
noZoom: null,
noTransparency: null,
+ menu: {},
subLayerMenu: {},
swipe: null,
swiperButtonStyle: 'position:absolute;top:20px;left:120px;z-index:50;',
@@ -85,6 +86,8 @@ define([
});
return;
}
+ // add any user-defined controls - possibly for user-defined layers
+ this._controls = lang.mixin(this._controls, options.controls || {});
},
postCreate: function () {
this.inherited(arguments);
@@ -204,7 +207,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({
@@ -218,7 +221,8 @@ define([
swipe: null,
expanded: false,
sublayers: true,
- menu: this.subLayerMenu[layerInfo.type]
+ menu: this.menu[layerInfo.type],
+ subLayerMenu: this.subLayerMenu[layerInfo.type]
}, layerInfo.controlOptions)
});
layerControl.startup();
@@ -344,29 +348,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);
}
@@ -477,4 +489,4 @@ define([
}
});
return LayerControl;
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/LayerControl/controls/Dynamic.js b/viewer/js/gis/dijit/LayerControl/controls/Dynamic.js
index bc6e8c453..c4ce2a847 100644
--- a/viewer/js/gis/dijit/LayerControl/controls/Dynamic.js
+++ b/viewer/js/gis/dijit/LayerControl/controls/Dynamic.js
@@ -88,6 +88,13 @@ define([
menu.addChild(new MenuSeparator());
}
},
+ _initCustomMenu: function () {
+ // add custom sublayer menu items if we only have one sublayer
+ if (!this._hasSublayers) {
+ array.forEach(this.controlOptions.subLayerMenu, lang.hitch(this, '_addCustomMenuItem', this.layerMenu));
+ this.layerMenu.addChild(new MenuSeparator());
+ }
+ },
// toggle all sublayers on/off
_toggleAllSublayers: function (state) {
array.forEach(this._sublayerControls, function (control) {
@@ -222,4 +229,4 @@ define([
}
});
return DynamicControl;
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/LayerControl/controls/Feature.js b/viewer/js/gis/dijit/LayerControl/controls/Feature.js
index 4ac2061a5..8706f5e29 100644
--- a/viewer/js/gis/dijit/LayerControl/controls/Feature.js
+++ b/viewer/js/gis/dijit/LayerControl/controls/Feature.js
@@ -28,4 +28,4 @@ define([
}
});
return FeatureControl;
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/LayerControl/controls/_Control.js b/viewer/js/gis/dijit/LayerControl/controls/_Control.js
index e9086017a..58e7f6179 100644
--- a/viewer/js/gis/dijit/LayerControl/controls/_Control.js
+++ b/viewer/js/gis/dijit/LayerControl/controls/_Control.js
@@ -10,6 +10,7 @@ define([
'dojo/dom-attr',
'dojo/fx',
'dojo/html',
+ 'dijit/MenuItem',
'./../plugins/LayerMenu',
'dojo/text!./templates/Control.html'
], function (
@@ -24,6 +25,7 @@ define([
domAttr,
fx,
html,
+ MenuItem,
LayerMenu,
template
) {
@@ -91,6 +93,7 @@ define([
leftClickToOpen: true
});
this.layerMenu.startup();
+ this._initCustomMenu();
} else {
domClass.remove(this.menuNode, 'fa, layerControlMenuIcon, ' + this.icons.menu);
domStyle.set(this.menuClickNode, 'cursor', 'default');
@@ -117,6 +120,21 @@ define([
layer.on('visibility-change', lang.hitch(this, '_visibilityChange'))
);
},
+ _initCustomMenu: function () {
+ array.forEach(this.controlOptions.menu, lang.hitch(this, '_addCustomMenuItem', this.layerMenu));
+ },
+ _addCustomMenuItem: function (menu, menuItem) {
+ //create the menu item
+ var item = new MenuItem(menuItem);
+ item.set('onClick', lang.hitch(this, function () {
+ topic.publish('layerControl/' + menuItem.topic, {
+ layer: this.layer,
+ iconNode: this.iconNode,
+ menuItem: item
+ });
+ }));
+ menu.addChild(item);
+ },
// add on event to expandClickNode
_expandClick: function () {
this._expandClickHandler = on(this.expandClickNode, 'click', lang.hitch(this, '_expandClicked'));
@@ -147,7 +165,13 @@ define([
domConst.destroy(this.expandNode);
},
// set layer visibility and update icon
- _setLayerVisibility: function (layer, checkNode) {
+ _setLayerVisibility: function (layer, checkNode, event) {
+
+ // prevent click event from bubbling
+ if (event.stopPropagation) {
+ event.stopPropagation();
+ }
+
if (layer.visible) {
this._setLayerCheckbox(layer, checkNode);
layer.hide();
@@ -253,4 +277,4 @@ define([
}
});
return _Control;
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/LayerControl/controls/_DynamicFolder.js b/viewer/js/gis/dijit/LayerControl/controls/_DynamicFolder.js
index 584a3c9a4..15a601720 100644
--- a/viewer/js/gis/dijit/LayerControl/controls/_DynamicFolder.js
+++ b/viewer/js/gis/dijit/LayerControl/controls/_DynamicFolder.js
@@ -56,7 +56,13 @@ define([
} else {
this._setSublayerCheckbox(false, checkNode);
}
- this._handlers.push(on(checkNode, 'click', lang.hitch(this, function () {
+ this._handlers.push(on(checkNode, 'click', lang.hitch(this, function (event) {
+
+ // prevent click event from bubbling
+ if (event.stopPropagation) {
+ event.stopPropagation();
+ }
+
if (domAttr.get(checkNode, 'data-checked') === 'checked') {
this._setSublayerCheckbox(false, checkNode);
} else {
@@ -124,4 +130,4 @@ define([
}
});
return _DynamicFolder;
-});
\ No newline at end of file
+});
diff --git a/viewer/js/gis/dijit/LayerControl/controls/_DynamicSublayer.js b/viewer/js/gis/dijit/LayerControl/controls/_DynamicSublayer.js
index 3cce73151..51c9dd271 100644
--- a/viewer/js/gis/dijit/LayerControl/controls/_DynamicSublayer.js
+++ b/viewer/js/gis/dijit/LayerControl/controls/_DynamicSublayer.js
@@ -66,7 +66,13 @@ define([
} else {
this._setSublayerCheckbox(false, checkNode);
}
- this._handlers.push(on(checkNode, 'click', lang.hitch(this, function () {
+ this._handlers.push(on(checkNode, 'click', lang.hitch(this, function (event) {
+
+ // prevent click event from bubbling
+ if (event.stopPropagation) {
+ event.stopPropagation();
+ }
+
if (domAttr.get(checkNode, 'data-checked') === 'checked') {
this._setSublayerCheckbox(false, checkNode);
} else {
@@ -82,17 +88,17 @@ define([
this._handlers.push(this.control.layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange')));
}
//set up menu
- if (this.control.controlOptions.menu &&
- this.control.controlOptions.menu.length) {
- domClass.add(this.labelNode, 'menuLink');
- domClass.add(this.iconNode, 'menuLink');
+ if (this.control.controlOptions.subLayerMenu &&
+ this.control.controlOptions.subLayerMenu.length) {
this.menu = new Menu({
contextMenuForWindow: false,
- targetNodeIds: [this.labelNode],
+ targetNodeIds: [this.menuClickNode],
leftClickToOpen: true
});
- array.forEach(this.control.controlOptions.menu, lang.hitch(this, '_addMenuItem'));
+ array.forEach(this.control.controlOptions.subLayerMenu, lang.hitch(this, '_addMenuItem'));
this.menu.startup();
+ } else {
+ domClass.add(this.menuClickNode, 'hidden');
}
},
_addMenuItem: function (menuItem) {
diff --git a/viewer/js/gis/dijit/LayerControl/controls/templates/Control.html b/viewer/js/gis/dijit/LayerControl/controls/templates/Control.html
index 5836fe4b0..e7e224030 100644
--- a/viewer/js/gis/dijit/LayerControl/controls/templates/Control.html
+++ b/viewer/js/gis/dijit/LayerControl/controls/templates/Control.html
@@ -1,7 +1,7 @@