eclipsesource / eclipsesource/tabris-plugin-maps

Provide convenience API for removing all markers

Open
#17 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
16
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Currently, `marker.dispose()` removes the marker from the `map.getMarkers()` array. Something like:

```js
map.getMarkers().forEach(marker => marker.dispose());
```
... would not work, since the array would be modified by `marker.dispose()`. In this case one needs to use a reverse for loop, which is not very convenient:

```js
let markers = map.getMarkers();
for (let i = markers.length - 1; i >= 0; i--) {
markers[i].dispose();
}
```

I suggest offering a type for the markers collection similar to [`WidgetCollection`](https://tabrisjs.com/documentation/latest/api/WidgetCollection#widgetcollection), which allows disposing (e.g. `map.getMarkers().dispose()`) and configuring all markers at once.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.