here-sdk-examples icon indicating copy to clipboard operation
here-sdk-examples copied to clipboard

Disappearing map markers

Open WebeyeDev opened this issue 2 years ago • 1 comments

Hi.

We use the Flutter SDK version 4.12.5 to display MapMarkers. There seems to be an issue with MapMarkers that they disappear after some time. It seems to be related to switching map layers, as it appears most frequently when we switch between satellite and normal modes.

We found the following error in the logs: E/geoviz ( 3141): [ERROR] geoviz - Can't load image asset 'MapImage5131583026138167685.png' from file or asset repository.

You can find a video about the issue on the following link.

The following code is used to change the map layer:

void _onMapSchemeChanged(MapSchemeUiModel mapSchemeUiModel) {
    final brightness = WidgetsBinding.instance.window.platformBrightness;
    final hereMapScheme = widget._mapSchemeFormatter.format(mapSchemeUiModel, brightness);
    _hereMapController.mapScene.loadSceneForMapScheme(hereMapScheme, (p0) {});
  }

Please note that when we do this, we don't modify the displayed markers at all. The markers are moving quite frequently however as they are showing the position of vehicles.

WebeyeDev avatar Oct 10 '22 13:10 WebeyeDev

MapImage5131583026138167685.png looks like a dynamically created asset. When switching the map schemes, do you load updated assets on the fly? Also, when calling loadSceneForMapScheme(), please check in the callback if you get a MapError.

Note that in order to update a marker's location, you do not need to create new marker instances. Just call mapMarker.setCoordinates​(coords) on the existing instance.

If the image cannot be loaded, then this would explain why the marker disappears. Closing for now, please check if there is an issue with MapMarker creation on app side, otherwise, please reopen. Thanks.

Update: Meanwhile, we will also try to reproduce potential issues. Ticket on our end: #14781.

HERE-SDK-Support-Team avatar Oct 17 '22 08:10 HERE-SDK-Support-Team

Thanks for the ideas and tips. When we updated the sdk (to: 4.12.7) this issue was solved.

WebeyeDev avatar Nov 21 '22 10:11 WebeyeDev