गलत स्थिति के लिए एंड्रॉयड addmarker redirct

वोट
0

गूगल मैप्स में अगर मैं लॉग अक्षां के उत्पादन में पेस्ट और लॉग तक यह स्थान सही करने के लिए पुनर्निर्देश लेकिन animateCamera()गलत जगह पर रीडायरेक्ट हो रहा गूगल मैप्स में Android एप्लिकेशन। कृपया सहायता कीजिए!

 public void onSearch(View view){
            Log.i(******************,in search function);
            EditText locationTf = (EditText)findViewById(R.id.editText);
            String location = locationTf.getText().toString();
            Log.i(Entered location:,location);
            if(location != null || location.equals()){
                Log.i(In if statement,all condition are satisfied);
                Geocoder geocoder = new Geocoder(this);
                try {
                    addresses = geocoder.getFromLocationName(location,1);
                    Log.i(in try block,addresses.toString());
                } catch (IOException e) {
                    e.printStackTrace();
                }

                Address address = addresses.get(0);
                Log.i(after try catch block,address.toString());
                LatLng searchLatLng = new LatLng(address.getLatitude(),address.getLatitude());
                double logLat = address.getLatitude() ;
                double logLon = address.getLongitude() ;
                Log.i(********************,&&&&&&&&&&&&&&&&&&&&&&&&);
                Log.i(Double.toString(logLat),Double.toString(logLon));

                mMap.addMarker(new MarkerOptions().position(searchLatLng).title(Results));
                mMap.animateCamera(CameraUpdateFactory.newLatLng(searchLatLng));
               // mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(searchLatLng, 10));
            }
            else {

            }

        }
20/11/2017 को 17:04
का स्रोत उपयोगकर्ता
अन्य भाषाओं में...                            


1 जवाब

वोट
0

आप 2 lattitudes गुजर रहे हैं।

LatLng(address.getLatitude(),address.getLatitude());

के बजाय

LatLng(address.getLatitude(),address.getLongitude());
21/11/2017 को 05:39
का स्रोत उपयोगकर्ता

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more