Ajout des features de la carte vide
This commit is contained in:
parent
9fbf6daafb
commit
03f5bf0215
2 changed files with 33 additions and 6 deletions
12
js/places.js
12
js/places.js
|
|
@ -13,7 +13,12 @@ export const FEATURE_ID = Symbol("Feature id")
|
|||
*/
|
||||
export class PlaceDatabase extends EventTarget {
|
||||
|
||||
/** @type {Object<string, MapFeature>} */
|
||||
featuresById = {}
|
||||
|
||||
/** @type {MapFeature[]} */
|
||||
featuresShownOnEmptyMap = []
|
||||
|
||||
fullTextIndex = null
|
||||
|
||||
/**
|
||||
|
|
@ -166,6 +171,9 @@ export class PlaceDatabase extends EventTarget {
|
|||
buildIndex(){
|
||||
let database = this;
|
||||
|
||||
this.featuresShownOnEmptyMap = []
|
||||
let showOnEmptyMap = this.featuresShownOnEmptyMap
|
||||
|
||||
this.fullTextIndex = lunr(function(){
|
||||
this.ref("id")
|
||||
this.field("name")
|
||||
|
|
@ -184,6 +192,10 @@ export class PlaceDatabase extends EventTarget {
|
|||
synonyms.push(...sym.indexSynonyms)
|
||||
}
|
||||
|
||||
if(feature.properties["show-on-empty-map"]){
|
||||
showOnEmptyMap.push(feature)
|
||||
}
|
||||
|
||||
this.add({
|
||||
id,
|
||||
name: feature.properties.name || sym.genericName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue