Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用这个简单的逻辑,在不使用 clear() 函数的情况下在 Tomtom 地图上添加和显示标记。创建一个布尔变量并根据您的需要进行更改。按钮就可以了,只需将值从 true 切换为 false 或将 false 切换为 true 即可显示。
MarkerBuilder marker = new MarkerBuilder(LatLng) .icon(Icon.Factory.fromResources(MainActivity.this, R.drawable.markerIcon)) .tag("marker-name"); if(putMarker == true) { tomtomMap.addMarker(marker); } else { tomtomMap.removeMarkerByTag("marker-name"); }