Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Use case
Description
There is an issue in the current implementation where user-specified marker IDs are ignored and new IDs are forcibly generated internally. This makes it difficult to manage, update, or delete individual markers.
Current Behavior
In common_view_api.dart
, _createMarkerId()
always generates a new ID, overwriting any ID that may have been set in MarkerOptionsDto
:
final List<MarkerDto> markersToAdd = options
.map((MarkerOptionsDto options) =>
MarkerDto(markerId: createMarkerId(), options: options))
.toList();
Proposal
The implementation should prioritize user-specified IDs and only auto-generate IDs when none are provided:
final List<MarkerDto> markersToAdd = options
.map((MarkerOptionsDto options) =>
MarkerDto(
markerId: options.markerId ?? createMarkerId(),
options: options
))
.toList();
- Preserves user-specified marker IDs
- Enables easier management of individual markers
- Allows reliable updating and deletion of existing markers