Skip to content

Commit f3375b5

Browse files
committed
fix: promise getFeatures
1 parent 3b40ac7 commit f3375b5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/configure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Behaviors control the look & feel of the map. Changing them will always regenera
164164
|notify|`message`:string, `duration`:number| Show notify `message` at bottom of map. Duration defaults too 2000ms|
165165
|showPopup|`coordinates`:array,`message`:string|Show a popup at the Coordinates with message
166166
|setFeatures|`layer`:string, `data`:object/string, `clear`:boolean, [returns `boolean`]|Add one ore more GEOJson features to the given layer, when clear is true all features of layer will be deleted before adding. When `merge` is true merge will done base on feature type and location. |
167-
|getFeatures|`layer`:string [returns `object`]|Get all features returning a `GEOJson` for the given layer|
167+
|getFeatures|`layer`:string [returns `promise`]|Get all features returning a `GEOJson` for the given layer|
168168
|clearFeatures|`layer`:string|Clear all features for the given layer|
169169
|setConfig|`json`:object,`filter`:string/array |Set configuration of the plugin by json, filter by properties. When filter is empty array[] all items will be update, when null only layers is update or the specified in filter|
170170
|getConfig|`filter`:string/array [returns `object`]|Get configuration of the plugin by returning `json`, filter by properties. When filter is empty array[] all items will be returned, when null only layers is update, or the specified in filter|

src/GEOComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ GEOComp = withMethodExposing(GEOComp, [
514514
},
515515
execute: async (comp: any, params: any) => {
516516
var map = comp.exposingValues.events['map:init']
517-
if (map) return await getFeatures(map, params[0])
518-
return null
517+
if (map) return getFeatures(map, params[0])
518+
return Promise.reject()
519519
}
520520
},
521521
{

src/vendors/helpers/Layers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ export async function getFeatures(map, name) {
356356
featureProjection: map.getView().getProjection() || 'EPSG:3857'
357357
}).writeFeaturesObject(source.getFeatures())
358358
}
359-
return null
359+
return Promise.reject()
360360
}
361361

362362

0 commit comments

Comments
 (0)