Interface option to hide caption menus
This commit is contained in:
parent
57ba42061c
commit
423084e9ea
3 changed files with 35 additions and 21 deletions
|
@ -954,12 +954,14 @@ L.U.AttributionControl = L.Control.Attribution.extend({
|
||||||
if (this._map.options.shortCredit) {
|
if (this._map.options.shortCredit) {
|
||||||
L.DomUtil.add('span', '', this._container, ' — ' + L.Util.toHTML(this._map.options.shortCredit));
|
L.DomUtil.add('span', '', this._container, ' — ' + L.Util.toHTML(this._map.options.shortCredit));
|
||||||
}
|
}
|
||||||
|
if (this._map.options.captionMenus) {
|
||||||
var link = L.DomUtil.add('a', '', this._container, ' — ' + L._('About'));
|
var link = L.DomUtil.add('a', '', this._container, ' — ' + L._('About'));
|
||||||
L.DomEvent
|
L.DomEvent
|
||||||
.on(link, 'click', L.DomEvent.stop)
|
.on(link, 'click', L.DomEvent.stop)
|
||||||
.on(link, 'click', this._map.displayCaption, this._map)
|
.on(link, 'click', this._map.displayCaption, this._map)
|
||||||
.on(link, 'dblclick', L.DomEvent.stop);
|
.on(link, 'dblclick', L.DomEvent.stop);
|
||||||
if (window.top === window.self) {
|
}
|
||||||
|
if (window.top === window.self && this._map.options.captionMenus) {
|
||||||
// We are not in iframe mode
|
// We are not in iframe mode
|
||||||
var home = L.DomUtil.add('a', '', this._container, ' — ' + L._('Home'));
|
var home = L.DomUtil.add('a', '', this._container, ' — ' + L._('Home'));
|
||||||
home.href = '/';
|
home.href = '/';
|
||||||
|
@ -1150,7 +1152,8 @@ L.U.IframeExporter = L.Evented.extend({
|
||||||
embedControl: null,
|
embedControl: null,
|
||||||
datalayersControl: true,
|
datalayersControl: true,
|
||||||
onLoadPanel: 'none',
|
onLoadPanel: 'none',
|
||||||
captionBar: false
|
captionBar: false,
|
||||||
|
captionMenus: true
|
||||||
},
|
},
|
||||||
|
|
||||||
dimensions: {
|
dimensions: {
|
||||||
|
|
|
@ -759,6 +759,7 @@ L.U.FormBuilder = L.FormBuilder.extend({
|
||||||
onLoadPanel: {handler: 'onLoadPanel', label: L._('Do you want to display a panel on load?')},
|
onLoadPanel: {handler: 'onLoadPanel', label: L._('Do you want to display a panel on load?')},
|
||||||
displayPopupFooter: {handler: 'Switch', label: L._('Do you want to display popup footer?')},
|
displayPopupFooter: {handler: 'Switch', label: L._('Do you want to display popup footer?')},
|
||||||
captionBar: {handler: 'Switch', label: L._('Do you want to display a caption bar?')},
|
captionBar: {handler: 'Switch', label: L._('Do you want to display a caption bar?')},
|
||||||
|
captionMenus: {handler: 'Switch', label: L._('Do you want to display caption menus?')},
|
||||||
zoomTo: {handler: 'IntInput', placeholder: L._('Inherit'), helpEntries: 'zoomTo', label: L._('Default zoom level'), inheritable: true},
|
zoomTo: {handler: 'IntInput', placeholder: L._('Inherit'), helpEntries: 'zoomTo', label: L._('Default zoom level'), inheritable: true},
|
||||||
showLabel: {handler: 'LabelChoice', label: L._('Display label'), inheritable: true},
|
showLabel: {handler: 'LabelChoice', label: L._('Display label'), inheritable: true},
|
||||||
labelDirection: {handler: 'LabelDirection', label: L._('Label direction'), inheritable: true},
|
labelDirection: {handler: 'LabelDirection', label: L._('Label direction'), inheritable: true},
|
||||||
|
|
|
@ -43,6 +43,7 @@ L.Map.mergeOptions({
|
||||||
],
|
],
|
||||||
moreControl: true,
|
moreControl: true,
|
||||||
captionBar: false,
|
captionBar: false,
|
||||||
|
captionMenus: true,
|
||||||
slideshow: {},
|
slideshow: {},
|
||||||
clickable: true,
|
clickable: true,
|
||||||
easing: true,
|
easing: true,
|
||||||
|
@ -89,6 +90,7 @@ L.U.Map.include({
|
||||||
L.Util.setBooleanFromQueryString(this.options, 'displayDataBrowserOnLoad');
|
L.Util.setBooleanFromQueryString(this.options, 'displayDataBrowserOnLoad');
|
||||||
L.Util.setBooleanFromQueryString(this.options, 'displayCaptionOnLoad');
|
L.Util.setBooleanFromQueryString(this.options, 'displayCaptionOnLoad');
|
||||||
L.Util.setBooleanFromQueryString(this.options, 'captionBar');
|
L.Util.setBooleanFromQueryString(this.options, 'captionBar');
|
||||||
|
L.Util.setBooleanFromQueryString(this.options, 'captionMenus');
|
||||||
for (var i = 0; i < this.HIDDABLE_CONTROLS.length; i++) {
|
for (var i = 0; i < this.HIDDABLE_CONTROLS.length; i++) {
|
||||||
L.Util.setNullableBooleanFromQueryString(this.options, this.HIDDABLE_CONTROLS[i] + 'Control');
|
L.Util.setNullableBooleanFromQueryString(this.options, this.HIDDABLE_CONTROLS[i] + 'Control');
|
||||||
}
|
}
|
||||||
|
@ -628,7 +630,8 @@ L.U.Map.include({
|
||||||
'queryString.miniMap',
|
'queryString.miniMap',
|
||||||
'queryString.scaleControl',
|
'queryString.scaleControl',
|
||||||
'queryString.onLoadPanel',
|
'queryString.onLoadPanel',
|
||||||
'queryString.captionBar'
|
'queryString.captionBar',
|
||||||
|
'queryString.captionMenus'
|
||||||
];
|
];
|
||||||
for (var i = 0; i < this.HIDDABLE_CONTROLS.length; i++) {
|
for (var i = 0; i < this.HIDDABLE_CONTROLS.length; i++) {
|
||||||
UIFields.push('queryString.' + this.HIDDABLE_CONTROLS[i] + 'Control');
|
UIFields.push('queryString.' + this.HIDDABLE_CONTROLS[i] + 'Control');
|
||||||
|
@ -1067,6 +1070,7 @@ L.U.Map.include({
|
||||||
'popupContentTemplate',
|
'popupContentTemplate',
|
||||||
'zoomTo',
|
'zoomTo',
|
||||||
'captionBar',
|
'captionBar',
|
||||||
|
'captionMenus',
|
||||||
'slideshow',
|
'slideshow',
|
||||||
'sortKey',
|
'sortKey',
|
||||||
'labelKey',
|
'labelKey',
|
||||||
|
@ -1232,10 +1236,14 @@ L.U.Map.include({
|
||||||
'options.scaleControl',
|
'options.scaleControl',
|
||||||
'options.onLoadPanel',
|
'options.onLoadPanel',
|
||||||
'options.displayPopupFooter',
|
'options.displayPopupFooter',
|
||||||
'options.captionBar'
|
'options.captionBar',
|
||||||
|
'options.captionMenus'
|
||||||
]);
|
]);
|
||||||
builder = new L.U.FormBuilder(this, UIFields, {
|
builder = new L.U.FormBuilder(this, UIFields, {
|
||||||
callback: this.renderControls,
|
callback: function() {
|
||||||
|
this.renderControls();
|
||||||
|
this.initCaptionBar();
|
||||||
|
},
|
||||||
callbackContext: this
|
callbackContext: this
|
||||||
});
|
});
|
||||||
var controlsOptions = L.DomUtil.createFieldset(container, L._('User interface options'));
|
var controlsOptions = L.DomUtil.createFieldset(container, L._('User interface options'));
|
||||||
|
@ -1450,6 +1458,7 @@ L.U.Map.include({
|
||||||
name = L.DomUtil.create('h3', '', container);
|
name = L.DomUtil.create('h3', '', container);
|
||||||
L.DomEvent.disableClickPropagation(container);
|
L.DomEvent.disableClickPropagation(container);
|
||||||
this.permissions.addOwnerLink('span', container);
|
this.permissions.addOwnerLink('span', container);
|
||||||
|
if (this.options.captionMenus) {
|
||||||
var about = L.DomUtil.add('a', 'umap-about-link', container, ' — ' + L._('About'));
|
var about = L.DomUtil.add('a', 'umap-about-link', container, ' — ' + L._('About'));
|
||||||
about.href = '#';
|
about.href = '#';
|
||||||
L.DomEvent.on(about, 'click', this.displayCaption, this);
|
L.DomEvent.on(about, 'click', this.displayCaption, this);
|
||||||
|
@ -1461,6 +1470,7 @@ L.U.Map.include({
|
||||||
filter.href = '#';
|
filter.href = '#';
|
||||||
L.DomEvent.on(filter, 'click', L.DomEvent.stop)
|
L.DomEvent.on(filter, 'click', L.DomEvent.stop)
|
||||||
.on(filter, 'click', this.openFilter, this);
|
.on(filter, 'click', this.openFilter, this);
|
||||||
|
}
|
||||||
var setName = function () {
|
var setName = function () {
|
||||||
name.textContent = this.getDisplayName();
|
name.textContent = this.getDisplayName();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue