Merge pull request #1446 from umap-project/interactive-layer
Allow to control the `interactive` option from the layer
This commit is contained in:
commit
87132314df
4 changed files with 11 additions and 13 deletions
|
@ -644,7 +644,7 @@ L.U.Help = L.Class.extend({
|
||||||
facetKey: L._(
|
facetKey: L._(
|
||||||
'Comma separated list of properties to use for facet search (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key)'
|
'Comma separated list of properties to use for facet search (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key)'
|
||||||
),
|
),
|
||||||
interactive: L._('If false, the polygon will act as a part of the underlying map.'),
|
interactive: L._('If false, the polygon or line will act as a part of the underlying map.'),
|
||||||
outlink: L._('Define link to open in a new window on polygon click.'),
|
outlink: L._('Define link to open in a new window on polygon click.'),
|
||||||
dynamicRemoteData: L._('Fetch data each time map view changes.'),
|
dynamicRemoteData: L._('Fetch data each time map view changes.'),
|
||||||
proxyRemoteData: L._("To use if remote server doesn't allow cross domain (slower)"),
|
proxyRemoteData: L._("To use if remote server doesn't allow cross domain (slower)"),
|
||||||
|
|
|
@ -1144,18 +1144,9 @@ L.U.Polygon = L.Polygon.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
getInteractionOptions: function () {
|
getInteractionOptions: function () {
|
||||||
const options = [
|
const options = L.U.FeatureMixin.getInteractionOptions()
|
||||||
[
|
options.push('properties._umap_options.interactive')
|
||||||
'properties._umap_options.interactive',
|
return options
|
||||||
{
|
|
||||||
handler: 'Switch',
|
|
||||||
label: L._('Allow interactions'),
|
|
||||||
helpEntries: 'interactive',
|
|
||||||
inheritable: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
return options.concat(L.U.FeatureMixin.getInteractionOptions())
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getMeasure: function (shape) {
|
getMeasure: function (shape) {
|
||||||
|
|
|
@ -1255,6 +1255,12 @@ L.U.FormBuilder = L.FormBuilder.extend({
|
||||||
helpText: L._('Optional.'),
|
helpText: L._('Optional.'),
|
||||||
},
|
},
|
||||||
toZoom: { handler: 'IntInput', label: L._('To zoom'), helpText: L._('Optional.') },
|
toZoom: { handler: 'IntInput', label: L._('To zoom'), helpText: L._('Optional.') },
|
||||||
|
interactive: {
|
||||||
|
handler: 'Switch',
|
||||||
|
label: L._('Allow interactions'),
|
||||||
|
helpEntries: 'interactive',
|
||||||
|
inheritable: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function (obj, fields, options) {
|
initialize: function (obj, fields, options) {
|
||||||
|
|
|
@ -1238,6 +1238,7 @@ L.U.DataLayer = L.Evented.extend({
|
||||||
'options.labelDirection',
|
'options.labelDirection',
|
||||||
'options.labelInteractive',
|
'options.labelInteractive',
|
||||||
'options.outlinkTarget',
|
'options.outlinkTarget',
|
||||||
|
'options.interactive',
|
||||||
]
|
]
|
||||||
builder = new L.U.FormBuilder(this, popupFields, { callback: redrawCallback })
|
builder = new L.U.FormBuilder(this, popupFields, { callback: redrawCallback })
|
||||||
const popupFieldset = L.DomUtil.createFieldset(
|
const popupFieldset = L.DomUtil.createFieldset(
|
||||||
|
|
Loading…
Reference in a new issue