获取一个gps数组,在地图polilayn上绘制。然而,对于某些坐标插入方向,但图标并不总是插入,应该有“边距”
如何插入图标以使其位于polilayn线上?
void addTraclMarker(double locationA,double locationB, int drawable,
String carnames, String carspeeds)
{
Marker startMarker = new Marker(mapView);
startMarker.setPosition(new GeoPoint(locationA,locationB));
startMarker.setIcon(getResources().getDrawable(drawable));
startMarker.setTitle("jkdfghspdifj");
startMarker.setAnchor(Marker.ANCHOR_CENTER, 1.0f);
MarkerInfoWindow infoWindow = new MyInfoWindow(R.layout.bonuspack_bubble,
mapView,carnames,carspeeds,"","");
startMarker.setInfoWindow(infoWindow);
mapView.getOverlays().add(startMarker);
}
答案 0 :(得分:1)
startMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_CENTER);
查看Marker#setAnchor以了解其工作原理。