File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ const tentacleFirstTag: { [key in TentacleLocations]: "amenity" | "tourism" } =
105105export const findTentacleLocations = async ( question : TentacleQuestion ) => {
106106 const query = `
107107[out:json][timeout:25];
108- nw ["${ tentacleFirstTag [ question . locationType ] } "="${
108+ nwr ["${ locationFirstTag [ question . locationType ] } "="${
109109 question . locationType
110110 } "](around:${ turf . convertLength (
111111 question . radius ,
@@ -125,6 +125,24 @@ out center;
125125
126126 elements . forEach ( ( element : any ) => {
127127 if ( ! element . tags [ "name" ] && ! element . tags [ "name:en" ] ) return ;
128+
129+ if ( element . lat && element . lon ) {
130+ const name = element . tags [ "name:en" ] ?? element . tags [ "name" ] ;
131+
132+ if (
133+ response . features . find (
134+ ( feature : any ) => feature . properties . name === name ,
135+ )
136+ )
137+ return ;
138+
139+ response . features . push (
140+ turf . point ( [ element . lon , element . lat ] , {
141+ name,
142+ } ) ,
143+ ) ;
144+ }
145+
128146 if ( ! element . center || ! element . center . lon || ! element . center . lat )
129147 return ;
130148
You can’t perform that action at this time.
0 commit comments