I am trying to add activity as a function to the application that I create there, the API will return a long long, and with that lat long I will load google street view. Which with the movement of the device will rotate the angle of rotation by 360 degrees. I fight for part of the movement of the device. Using your fingers on the screen, you can rotate. I wonder if someone can point me in the right direction so that the movement of the device affects the position of the street?
The code I have so far is:
import android.support.v4.app.FragmentActivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import com.google.android.gms.maps.OnStreetViewPanoramaReadyCallback; import com.google.android.gms.maps.StreetViewPanorama; import com.google.android.gms.maps.StreetViewPanoramaFragment; import com.google.android.gms.maps.StreetViewPanoramaOptions; import com.google.android.gms.maps.StreetViewPanoramaView; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.StreetViewPanoramaCamera; import com.google.android.gms.maps.model.StreetViewPanoramaLocation; public class MainActivity extends FragmentActivity implements OnStreetViewPanoramaReadyCallback { private static final String TAG = MainActivity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); StreetViewPanoramaFragment streetViewPanoramaFragment = (StreetViewPanoramaFragment) getFragmentManager() .findFragmentById(R.id.streetviewpanorama); streetViewPanoramaFragment.getStreetViewPanoramaAsync(this); } @Override public void onStreetViewPanoramaReady(final StreetViewPanorama panorama) { final long duration = 1000; float tilt = 30; float bearing = 90; final StreetViewPanoramaCamera camera = new StreetViewPanoramaCamera.Builder() .zoom(panorama.getPanoramaCamera().zoom) .bearing(bearing) .tilt(tilt) .build(); panorama.setPosition(new LatLng(52.208818, 0.090587)); panorama.setStreetNamesEnabled(false); panorama.setZoomGesturesEnabled(false); panorama.setOnStreetViewPanoramaChangeListener(new StreetViewPanorama.OnStreetViewPanoramaChangeListener() { @Override public void onStreetViewPanoramaChange(StreetViewPanoramaLocation streetViewPanoramaLocation) { if (streetViewPanoramaLocation != null) { panorama.animateTo(camera, duration); } Log.d(TAG, "TESTINGGGGGGGGGG"); } }); } }
I'm not sure I asked your question, so a comment if I'm wrong, but it looks like you can rotate this instruction
panorama.animateTo(camera, duration);
, "", .
, , , ( ) , , . , ( ), , ( → , → ).
, , , .
, / .
Source: https://habr.com/ru/post/1016355/More articles:Convert horizontal CSV template to table format - sqlRTMP adaptive bit rate algorithm - androidNative RBAC library for NodeJS - node.jshow to limit request per second in apache testing tools - springЗависимые библиотеки DLL пакета NuGet, не скопированные в папку вывода - c#Selenium Chrome WebDriver открывает настройку по умолчанию, задав reset настройку - seleniumJava date and time date from ZonedDateTime UTC instance - javaHow to stop the chrome key from opening the settings tab automatically? - ruby | fooobar.comUsing VSTS Version Definition to Run Entity Framework Object Database Migration - azureКак разрешить Nodejs: Ошибка: ENOENT: нет такого файла или каталога - node.jsAll Articles