gpt4 book ai didi

android - 如何使谷歌地图多个标记信息窗口保持打开状态android

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:25:31 26 4
gpt4 key购买 nike

我想让在标记上打开的信息窗口保持打开状态,即使在谷歌地图上指向另一个标记也是如此。这是我的代码。

                 private void drawMarker(LatLng point, String pLoc){
// Creating an instance of MarkerOptions
MarkerOptions markerOptions = new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.map_pin_green));

// Setting latitude and longitude for the marker
markerOptions.position(point);

markerOptions.title(pLoc);


// Adding the marker to the map
m_cGoogleMap.addMarker(markerOptions).showInfoWindow();

m_cGoogleMap.setInfoWindowAdapter(new MarkerInfoWindowAdapter(null));
}

我正在调用这个简单的方法来添加多个标记。使用 showInfoWindow() 方法只是打开当前标记的信息窗口,但我希望信息窗口始终为当前和以前的标记(多个)保持打开状态。

请帮帮我!!

谢谢。

最佳答案

根据官方文档here .它说:

Only one info window is displayed at a time. If a user clicks on another marker, the current info window will be hidden and the new info window will be displayed.

所以如果你想为你的标记显示更多信息,你可以考虑使用 android-maps-utils 库。更多详情请引用here .

关于android - 如何使谷歌地图多个标记信息窗口保持打开状态android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32181051/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com