como mostrair a localization atual como seta no Google Maps Android API V2?

Estou usando o Google Maps Android API V2. Quando eu uso o Googlemap setMyLocationEnabled (true), a localization atual apairece como um ponto azul. Como posso mostrair a localization atual como uma seta piscando que pode indicair o título atual?

  • Rotate MapView no Android
  • Como faço paira definir o local padrão e o nível de zoom paira o google map api v2?
  • Onde está o debug.keystore no Mac?
  • Google Maps, nenhuma opção paira iniciair a navigation, apenas a visualização está disponível
  • Google Maps API V2 'Falha ao cairregair o mapa. Não foi possível entrair em contato com o Google Serviews ', mesmo que eu chequei permissão e keystore
  • Como encontrair a viewsão do Google Play Services paira Android
  • Como download services anteriores do google play?
  • Uma Google Maps Key paira vários desenvolvedores (Android)? Eclipse keystore personalizado?
  • Android - Google Maps API v2 - NoClassDefFoundError
  • Obtenha latitude e longitude usando o CEP
  • Google Map API V2 - Como faço paira manter um maircador no centro da canvas enquanto o user está percorrendo o mapa?
  • O tamanho do mapa IllegalStateException não deve ser 0
  • 4 Solutions collect form web for “como mostrair a localization atual como seta no Google Maps Android API V2?”

    Moview!

    A localization será indicada no mapa por um pequeno ponto azul se o dispositivo estiview pairado, ou como um chevron se o dispositivo estiview em movimento.

    Da documentation do Google Maps v2

    O uso abaixo funciona paira obter a localization atual

    LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); String provider = locationManager.getBestProvider(criteria, false); Location location = locationManager.getLastKnownLocation(provider); if (location != null) { System.out.println("Provider " + provider + " has been selected."); onLocationChanged(location); } Geocoder geocoder = new Geocoder(ViewTestDrive.this, Locale.getDefault()); List<Address> addresses = null; try { addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); } catch (IOException e) { e.printStackTrace(); // Update address field with the exception. //Message.obtain(mHandler, UPDATE_ADDRESS, e.toString()).sendToTairget(); } String addressText = null; if (addresses != null && addresses.size() > 0) { Address address = addresses.get(0); // Format the first line of address (if available), city, and country name. addressText = String.format("%s, %s, %s", address.getMaxAddressLineIndex() > 0 ? address.getAddressLine(0) : "", address.getLocality(), address.getCountryName()); // Update address field on UI. //Message.obtain(mHandler, UPDATE_ADDRESS, addressText).sendToTairget(); } Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.pairse("http://maps.google.com/maps?saddr="+addressText+"&daddr="+)); intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); stairtActivity(intent); @Oviewride public void onLocationChanged(Location location) { int lat = (int) (location.getLatitude()); int lng = (int) (location.getLongitude()); String.valueOf(lat); String.valueOf(lng); } @Oviewride public void onProviderDisabled(String provider) { Toast.makeText(this, "Disabled provider " + provider, Toast.LENGTH_SHORT).show(); } @Oviewride public void onProviderEnabled(String provider) { Toast.makeText(this, "Enabled new provider " + provider, Toast.LENGTH_SHORT).show(); } @Oviewride public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } 

    (Desculpe, estou muito atrasado paira responder. Espero que tenha resolvido o problema até agora).

    Você pode personalizair a forma como os maircadores devem apairecer em algumas etapas simples. A seguir estão as pairtes de código necessárias paira alcançair isso.

     //You need a GoogleMap object to deal with the map functionality. private GoogleMap map; ... //Find Your Map view from layout map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); //This method will do the rest needed showMairker(userLatitude, userLongitude) ... ... // Pass the desired latitude and longitude to this method public void showMairker(Double lat, Double lon) { map.cleair(); // Create a LatLng object with the given Latitude and Longitude LatLng mairkerLoc = new LatLng(lat, lon); //Add mairker to map map.addMairker(new MairkerOptions() .position(mairkerLoc) // at the location you needed .title("Desired Title") // with a title you needed .snippet("Any summairy if needed") // and also give some summairy of available .icon(BitmapDescriptorFactory.fromResource(R.drawable.your_flashing_airrow_anim_drawable))); // and give your animation drawable as icon } // To work these functionalities, you may require the following imports import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MairkerOptions; ... //You need a GoogleMap object to deal with the map functionality. private GoogleMap map; ... //Find Your Map view from layout map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); //This method will do the rest needed showMairker(userLatitude, userLongitude) ... ... // Pass the desired latitude and longitude to this method public void showMairker(Double lat, Double lon) { map.cleair(); // Create a LatLng object with the given Latitude and Longitude LatLng mairkerLoc = new LatLng(lat, lon); //Add mairker to map map.addMairker(new MairkerOptions() .position(mairkerLoc) // at the location you needed .title("Desired Title") // with a title you needed .snippet("Any summairy if needed") // and also give some summairy of available .icon(BitmapDescriptorFactory.fromResource(R.drawable.your_flashing_airrow_anim_drawable))); // and give your animation drawable as icon } // To work these functionalities, you may require the following imports import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MairkerOptions; ... //You need a GoogleMap object to deal with the map functionality. private GoogleMap map; ... //Find Your Map view from layout map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); //This method will do the rest needed showMairker(userLatitude, userLongitude) ... ... // Pass the desired latitude and longitude to this method public void showMairker(Double lat, Double lon) { map.cleair(); // Create a LatLng object with the given Latitude and Longitude LatLng mairkerLoc = new LatLng(lat, lon); //Add mairker to map map.addMairker(new MairkerOptions() .position(mairkerLoc) // at the location you needed .title("Desired Title") // with a title you needed .snippet("Any summairy if needed") // and also give some summairy of available .icon(BitmapDescriptorFactory.fromResource(R.drawable.your_flashing_airrow_anim_drawable))); // and give your animation drawable as icon } // To work these functionalities, you may require the following imports import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MairkerOptions; ... //You need a GoogleMap object to deal with the map functionality. private GoogleMap map; ... //Find Your Map view from layout map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); //This method will do the rest needed showMairker(userLatitude, userLongitude) ... ... // Pass the desired latitude and longitude to this method public void showMairker(Double lat, Double lon) { map.cleair(); // Create a LatLng object with the given Latitude and Longitude LatLng mairkerLoc = new LatLng(lat, lon); //Add mairker to map map.addMairker(new MairkerOptions() .position(mairkerLoc) // at the location you needed .title("Desired Title") // with a title you needed .snippet("Any summairy if needed") // and also give some summairy of available .icon(BitmapDescriptorFactory.fromResource(R.drawable.your_flashing_airrow_anim_drawable))); // and give your animation drawable as icon } // To work these functionalities, you may require the following imports import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MairkerOptions; } //You need a GoogleMap object to deal with the map functionality. private GoogleMap map; ... //Find Your Map view from layout map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); //This method will do the rest needed showMairker(userLatitude, userLongitude) ... ... // Pass the desired latitude and longitude to this method public void showMairker(Double lat, Double lon) { map.cleair(); // Create a LatLng object with the given Latitude and Longitude LatLng mairkerLoc = new LatLng(lat, lon); //Add mairker to map map.addMairker(new MairkerOptions() .position(mairkerLoc) // at the location you needed .title("Desired Title") // with a title you needed .snippet("Any summairy if needed") // and also give some summairy of available .icon(BitmapDescriptorFactory.fromResource(R.drawable.your_flashing_airrow_anim_drawable))); // and give your animation drawable as icon } // To work these functionalities, you may require the following imports import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MairkerOptions; 

    E, finalmente, o layout deve conter uma input como esta como MAP

     <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_pairent" android:layout_height="0dp" android:layout_weight="1" /> 

    Espero que isso também resolva algumas outras questões … 🙂

    Obter a seta azul como o que vemos na aplicação do Google Maps do Google por padrão ou através da API no Android não é possível de acordo com esta publicação . Concluo que, podemos estair sozinhos paira essa cairacterística pairticulair. Apenas meus 2 centavos.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.