Skip to content

Commit

Permalink
#7 ajout lien vers table
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine37120 committed Apr 24, 2024
1 parent f63a174 commit 25af263
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/sparnatural-yasgui-plugins.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions src/sparnatural-yasr-map-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ export class MapPlugin implements SparnaturalPlugin<PluginConfig>{
polyOptions = this.config.searchedPolygon ;
const poly = new L.Polygon(feature as L.LatLngExpression[][], polyOptions)
this.layerGroups['searchPoly'] ? this.layerGroups['searchPoly'].addLayer(poly) : this.layerGroups['searchPoly'] = L.layerGroup([poly]);
//let pane = this.map.createPane('searchArea', this.map.getContainer())
poly.addTo(this.map).bringToBack();
this.calcBounds(feature) ;
}
Expand Down Expand Up @@ -439,9 +438,17 @@ export class MapPlugin implements SparnaturalPlugin<PluginConfig>{
this.warnEL = document.createElement('div')
this.warnEL.setAttribute('id','yasrmap-warnEL')
this.warnEL.setAttribute('class','alert alert-warning')
this.warnEL.innerText ='Attention, des résultats ('+this.haveResultWithoutGeo+') n\'ont pas de coordonnées pour être représentés sur la carte' ;
this.warnEL.innerText ='Attention, des résultats ('+this.haveResultWithoutGeo+') n\'ont pas de coordonnées pour être représentés sur la carte.' ;

parentEl.appendChild(this.warnEL) ;
let linkToTable = document.createElement('a');
linkToTable.classList.add('link', 'ms-2');
linkToTable.innerText = 'Afficher la table des résultats' ;
this.warnEL.appendChild(linkToTable) ;
linkToTable.addEventListener("click", ()=>{
(this.yasr as any).selectPlugin("table") ;
return false;
});
}


Expand Down

0 comments on commit 25af263

Please sign in to comment.