2016-11-24 10 views
6

Uygulamamda PlacePicker API kullanıyorum ve harita türünü basitten uyduya değiştirmek istiyorum.Harita türü Google Yerleşim API'sından basit bir yerden PlacePicker uyduya nasıl değiştirilir?

PlacePicker, Google tarafından sunulan bir API'sidir. İşte

ben kullanıyorum nasıl: onActivityResult() sonra

// Construct an intent for the place picker 
       try { 
        PlacePicker.IntentBuilder intentBuilder = 
          new PlacePicker.IntentBuilder(); 
        Intent intent = intentBuilder.build(this); 
        // Start the intent by requesting a result, 
        // identified by a request code. 
        startActivityForResult(intent, PLACE_PICKER_REQUEST); 

       } catch (GooglePlayServicesRepairableException e) { 
        Snackbar snackbar = Snackbar 
          .make(coordinatorLayout, e.getMessage(), Snackbar.LENGTH_SHORT); 
        snackbar.show(); 
        // ... 
       } catch (GooglePlayServicesNotAvailableException e) { 
        Snackbar snackbar = Snackbar 
          .make(coordinatorLayout, e.getMessage(), Snackbar.LENGTH_SHORT); 
        snackbar.show(); 
        // ... 
       } 

ve:

protected void onActivityResult(int requestCode, int resultCode, Intent data) { 
     if (requestCode == PLACE_PICKER_REQUEST 
       && resultCode == Activity.RESULT_OK) { 

      // The user has selected a place. Extract the name and address. 
      final Place place = PlacePicker.getPlace(data, this); 

      final CharSequence name = place.getName(); 
      final CharSequence address = place.getAddress(); 
      LatLng latLng = place.getLatLng(); 
      final double lat = latLng.latitude; 
      final double lng = latLng.longitude; 
      String attributions = PlacePicker.getAttributions(data); 
      if (attributions == null) { 
       attributions = ""; 
      } 

//   mViewName.setText(name); 
//   mViewAddress.setText(address); 
//   mViewAttributions.setText(Html.fromHtml(attributions)); 

     } else { 
      super.onActivityResult(requestCode, resultCode, data); 
     } 
    } 

Sadece basit bir harita türünü gösterir. Uydu harita haritasını göstermek istiyorum.

Lütfen bana nasıl yardımcı olacağını bildirin?

+0

Bence böyle bir seçenek yok. Çünkü bunun için belgelere bakarsanız, api için harita türüyle ilgili herhangi bir yerde belirtilmez. Bunun mümkün olup olmadığını bilmek ilginçtir. –

cevap

2

Harita tipi şu anda Yer Seçici'de değiştirmek mümkün değil. Yer API'sinin public issue tracker ürününe özellik isteği ekleyebilirsiniz.

+2

https://code.google.com/p/gmaps-api-issues/issues/detail?id=10940&thanks=10940&ts=1480037051 :) yapıldı –

İlgili konular