Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api-idee-js/src/plugins/wfstcontrols/src/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"parameters": [{
"type": "object",
"properties": [{
"type": "simple",
"name": "position",
"possibleValues": ["TL", "TR", "BL", "BR"],
"value": "TL"
},{
"type": "simple",
"name": "features",
"value": "drawfeature,modifyfeature,deletefeature,editattribute"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@
border: 2px solid red;
}

.m-left .m-panel.m-edition.opened div.m-control button[class^=g-cartografia-],
.m-left .m-panel.m-edition.opened div.m-control button[class*=" g-cartografia-"],
.m-right .m-panel.m-edition.opened div.m-control button[class^=g-cartografia-],
.m-right .m-panel.m-edition.opened div.m-control button[class*=" g-cartografia-"] {
color: #364b5f !important;
background-color: white !important;
opacity: 1;
}

.m-areas>div.m-area>div.m-panel.m-edition>div.m-panel-controls>div.m-control.activated>button {
color: #67af13 !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class WFSTControls extends IDEE.Plugin {
let layernamefix;
let geometryfix;
const proxyfix = {};
let optionsPosition = 'TL';

// Parse new controls model to the old one

Expand All @@ -43,6 +44,9 @@ export default class WFSTControls extends IDEE.Plugin {
geometryfix = controls.geometry;
proxyfix.status = controls.proxy ? controls.proxy.status === true || controls.proxy.status === 'true' : true;
proxyfix.disable = controls.proxy ? controls.proxy.disable === true || controls.proxy.disable === 'true' : true;
if (controls.position) {
optionsPosition = controls.position;
}
} else {
layernamefix = layername;
controlsfix = controls;
Expand All @@ -51,6 +55,9 @@ export default class WFSTControls extends IDEE.Plugin {
proxyfix.disable = proxyDisable;
}

const positions = ['TR', 'TL', 'BL', 'BR'];
this.position_ = positions.includes(optionsPosition) ? optionsPosition : 'TL';

/**
* Array of controls to be added
* @private
Expand Down Expand Up @@ -240,7 +247,7 @@ export default class WFSTControls extends IDEE.Plugin {
collapsible: true,
className: 'm-edition',
collapsedButtonClass: 'g-cartografia-editar',
position: IDEE.ui.position.TL,
position: IDEE.ui.position[this.position_],
tooltip: getValue('tooltip'),
});
if (IDEE.utils.isNullOrEmpty(wfslayer)) {
Expand Down
9 changes: 5 additions & 4 deletions api-idee-js/src/plugins/wfstcontrols/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IDEE.language.setLang('es');

const map = IDEE.map({
container: 'mapjs',
ticket: 'PWUMZ5MQTPUGAEWTHCXVXSFZLLAKXUNKBQSTBOWUDL4AZDOVZKN35B67X6SCPMMISIWNFHW7AAYH4MLGMG4G7NTD3HIALJ42K73PC7W7SQIUUCSKTEIXHCXP6VGOTNXJ4K2SAIEI2GAOURMWOMKWEDURE5K2H357Y35B5GI'
ticket: 'PWUMZ5MQTPUGAEWTHCXVXSFZLLAKXUNKBQSTBOWUDL4AZDOVZKN35B67X6SCPMMISIWNFHW7AAYH4MLGMG4G7NTD3HIALJ42K73PC7W7SQIUUCSKTEIXHCXP6VGOTNXJ4K2SAIEI2GAOURMWOMKWEDURE5K2H357Y35B5GI',
});
window.map = map;

Expand All @@ -14,14 +14,15 @@ const wfsLayer = new IDEE.layer.WFS({
legend: 'capa wfs',
name: 'superadmin_mispuntos_1758802353451',
geometry: 'LINE',
extract: false
extract: false,
});

map.addWFS(wfsLayer);

const mp = new WFSTControls({
"features": "drawfeature,modifyfeature,deletefeature,editattribute",
"proxy": {}
features: 'drawfeature,modifyfeature,deletefeature,editattribute',
position: 'BR',
proxy: {},
});

map.addPlugin(mp); window.mp = mp;
Expand Down