Skip to content

Commit

Permalink
actualizado api.json
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliopardo committed Sep 23, 2021
1 parent e873237 commit e50a8ed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
20 changes: 13 additions & 7 deletions dist/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@
"separator": "*"
},
"constructor": "M.plugin.Simplelegend",
"parameters": [],
"parameters": [{
"type": "object",
"properties": [{
"title": "[String] texto a mostrar en el titulo de panel",
"draggable": "[Boolean] true o false para hacer draggable la leyenda",
"layers": "[Array] listado de layers de Mapea a mostrar en la leyenda"
}],
"files": {
"ol": {
"scripts": [],
"styles": []
"scripts": ["simplelegend.ol.min.js"],
"styles": ["simplelegend.ol.min.css"]
}
},
"metadata": {
"uuid_plugin": "",
"uuid_version_plugin": "",
"version_ficha_metadatos": "",
"name": "Simplelegend",
"description": "Description of the plugin",
"text": "A full text about plugin",
"description": "Muestra una leyenda simple",
"text": "Muestra una leyenda simple de los layers de Mapea tanto Raster como Vectoriales. Se puede actualizar en tiempo de ejecución y permite la posibilidad de que la leyenda sea draggable",
"version": "1.0.0",
"date": "",
"author": "",
"date": "Septiembre, 2021",
"author": "Emilio Pardo",
"org": "",
"tags": "mapea,plugin",
"icon": "./facade/assets/icons/icons.svg",
Expand Down
30 changes: 17 additions & 13 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const map = M.map({
map.addControls(['ScaleLine', 'Mouse', 'panzoombar', 'layerSwitcher']);


/*INICIO TEST RASTER LAYER */
/*INICIO TEST RASTER LAYER */

let layer = new M.layer.WMS({
url: 'http://www.juntadeandalucia.es/institutodeestadisticaycartografia/geoserver-ieca/direst/wms?',
Expand Down Expand Up @@ -170,8 +170,8 @@ const configSimpleLegend2 = {


const configSimpleLegend3 = {
title: 'Leyenda',
draggable: true,
title: 'TEST TITULO',
draggable: false,
layers: [agricultura
]
}
Expand All @@ -188,8 +188,8 @@ const configSimpleLegend4 = {

// TEST 1 CAPA WMS

// map.addLayers([layer]);
// const mp = new Simplelegend(configSimpleLegend1);
map.addLayers([layer]);
const mp = new Simplelegend(configSimpleLegend1);


// TEST 2 ARRAY CAPAS WMS
Expand All @@ -205,13 +205,17 @@ const configSimpleLegend4 = {

//TEST 4 ARRAY CAPA RASTER Y VECTOR

const mp = new Simplelegend(configSimpleLegend4);
map.addLayers([layer,agricultura]);
// const mp = new Simplelegend(configSimpleLegend4);
// map.addLayers([layer,agricultura]);



map.addPlugin(mp);

// mp.on(M.evt.ADDED_TO_MAP,()=>{
// alert('se cargo el plugin')
// })

// TEST ACTUALIZACIÓN

// setTimeout(() => {
Expand All @@ -220,9 +224,9 @@ map.addPlugin(mp);
// mp.updateLegend(layer) }
// , 4000);

// setTimeout(() => {
// map.removeLayers(layer)
// map.addLayers([layer1, layer2]);
// mp.updateLegend([layer1, layer2]);
// }
// , 8000);
setTimeout(() => {
map.removeLayers(layer)
map.addLayers([layer1, layer2]);
mp.updateLegend([layer1, layer2]);
}
, 4000);

0 comments on commit e50a8ed

Please sign in to comment.