0
有没有办法让我可以更改开始和结束标记的图标,如开始为蓝色,结束为红色,添加不同的细节并添加连接多段线?帮助Android地图标记更改开始和结束颜色,放置不同的细节并添加多段线
按钮:
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (int i = 0; i < list_location.size(); i++) {
createMarker(list_location.get(i).getLatitude(), list_location.get(i).getLongitude());
}
}
});
标记:
private void createMarker(String latitude, String longitude) {
// Adding the taped point to the ArrayList
BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.ic_menu_camera);
Double lat = Double.parseDouble(latitude);
Double Longitude = Double.parseDouble(longitude);
map.addMarker(new MarkerOptions()
.position(new LatLng(lat, Longitude))
.anchor(0.5f, 0.5f)
.title("title")
.snippet("snippet")
.icon(icon));
}
你好,感谢你的回答。我期待着折线。谢谢。 – user8256287
https://stackoverflow.com/a/25499892/1976626检查此答案可能有帮助... –
嗨迈克尔Shrestha,你可以请。用我的代码启发我?谢谢。 – user8256287