0
문제가 있습니다. 트럭과 위치를 보여주는 GPS 위치를 새로 고침해야합니다. 다음은 트럭을 표시하는 코드입니다.Java에서지도 새로 고침하는 방법
private static void addMarkerTruck(String name, double x, double y,
int mVitesse)
{
BitmapDescriptor icon;
double mLatitude =x;
double mLongitude = y;
Marker currentMarker = getMarker(name);
if (getMarker(name) != null)
{
currentMarker.setPosition(new LatLng(mLatitude, mLongitude));
}
else
{
if (mVitesse <= 0)
{
icon = BitmapDescriptorFactory.fromResource(R.drawable.truck_orange);
} else if (mVitesse > 5 && mVitesse < 90)
{
icon = BitmapDescriptorFactory.fromResource(R.drawable.truck_blue);
} else
{
icon = BitmapDescriptorFactory.fromResource(R.drawable.truck_black);
}
Marker mark = mMap.addMarker(new MarkerOptions()
.title(name)
.position(new LatLng(mLatitude, mLongitude))
.snippet(String.valueOf("Vitesse: " + mVitesse + " km/h ")).icon(icon));
vehicles.put(name, mark);
}
//mark.setPosition(latlng);
}
여기 새로 고침이 제대로 작동하지 않습니다.
public static void refreshMarkersPosition()
{
mMap.clear();
displayAllCar();
if (FragmentMainMenu.booleanShowPoi == 1)
{
displayAllPoi();
}
}
왜 모든 것이 정적입니까? – EpicPandaForce
코드를 작성하지 않았습니다. 나는 기존의 코드로 작업하고있다. 내 상사가 코드 –
nMap이 맞춤 클래스 인 것처럼 보입니다. 그것을 만든 사람에게 물어보십시오. – talex