android 当两个Map加载到同一片段但不同的帧上时,一个Map框Map将冻结

sq1bmfud  于 2023-01-19  发布在  Android
关注(0)|答案(1)|浏览(120)

We are getting the below error when trying to load two Mapbox maps in a fragment.

Can't update annotation: Symbol{geometry=Point{type=Point, bbox=null, coordinates=[-121.3559284, 38.9228032]}, properties={"symbol-sort-key":null,"icon-size":null,"icon-image":"marker-icon-id","icon-rotate":165.30766,"icon-offset":null,"icon-anchor":null,"text-field":null,"text-font":null,"text-size":null,"text-max-width":null,"text-letter-spacing":null,"text-justify":null,"text-radial-offset":null,"text-anchor":null,"text-rotate":null,"text-transform":null,"text-offset":null,"icon-opacity":null,"icon-color":null,"icon-halo-color":null,"icon-halo-width":null,"icon-halo-blur":null,"text-opacity":null,"text-color":null,"text-halo-color":null,"text-halo-width":null,"text-halo-blur":null,"id":2,"custom_data":null}, isDraggable=false}, the annotation isn't active annotation.

We have a fullscreen mapview on the screen, and on the right bottom, we have a small window for video. Using the symbol manager, we are showing current lat long on the map. It's working fine, and the symbol is moving properly once the application is loaded. When we click on the video, we get a full-screen video instead of a mapview, and a mapview instead of a small video. On that mapview we can also see the moving symbol with the current lat long. But when we click on that small mapview again, the full screen mapview is showing and the moving map icon is getting frozen.
Please see the reference below.

kgsdhlau

kgsdhlau1#

你首先需要检查你的注解是否存在于符号管理器中,如果不存在,先在符号管理器中添加它,然后更新那个注解。

if (!symbolManager.getAnnotations().containsValue("Your symbol"))
{
    SymbolOptions symbolOptions = new SymbolOptions();
    symbolOptions.withLatLng(newLatLng);
    symbolOptions.withIconImage("image");
    Your symbol= symbolManager.create(symbolOptions);
}

相关问题