6

मैं अपने ऐप में PlacePicker एपीआई का उपयोग कर रहा हूं और इसे सरल से उपग्रह में बदल सकता हूं।Google स्थल API से प्लेसपिकर के सरल से उपग्रह तक मानचित्र प्रकार को कैसे बदला जाए?

PlacePicker Google द्वारा प्रदान की गई एक एपीआई है।

यहाँ कैसे मैं इसे का उपयोग कर रहा है:

// 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(); 
        // ... 
       } 

और फिर onActivityResult() में:

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); 
     } 
    } 

यह केवल सरल मानचित्र प्रकार दिखाता है। मैं उपग्रह प्रकार का नक्शा दिखाना चाहता हूं।

कृपया मुझे बताएं कि कैसे करें?

+0

मुझे लगता है कि ऐसा कोई विकल्प नहीं दिया गया है। क्योंकि यदि आप इसके लिए प्रलेखन देखते हैं, तो जगह एपीआई के लिए मानचित्र प्रकार के बारे में कहीं भी इसका उल्लेख नहीं किया गया है। यह जानना दिलचस्प है कि यह संभव है या नहीं। –

उत्तर

2

प्लेस पिकर में मानचित्र प्रकार को बदलने के लिए वर्तमान में संभव नहीं है। आप प्लेस एपीआई के public issue tracker पर फीचर अनुरोध जोड़ सकते हैं।

+2

किया गया https://code.google.com/p/gmaps-api-issues/issues/detail?id=10940&thanks=10940&ts=1480037051 :) –

संबंधित मुद्दे