1. <tfoot id='0e0cC'></tfoot>

      <small id='0e0cC'></small><noframes id='0e0cC'>

          <bdo id='0e0cC'></bdo><ul id='0e0cC'></ul>

        <i id='0e0cC'><tr id='0e0cC'><dt id='0e0cC'><q id='0e0cC'><span id='0e0cC'><b id='0e0cC'><form id='0e0cC'><ins id='0e0cC'></ins><ul id='0e0cC'></ul><sub id='0e0cC'></sub></form><legend id='0e0cC'></legend><bdo id='0e0cC'><pre id='0e0cC'><center id='0e0cC'></center></pre></bdo></b><th id='0e0cC'></th></span></q></dt></tr></i><div id='0e0cC'><tfoot id='0e0cC'></tfoot><dl id='0e0cC'><fieldset id='0e0cC'></fieldset></dl></div>
        <legend id='0e0cC'><style id='0e0cC'><dir id='0e0cC'><q id='0e0cC'></q></dir></style></legend>

        如何在 Google Map Api V2 Android 中搜索?

        时间:2023-09-02

              <tbody id='yPjxH'></tbody>
              <bdo id='yPjxH'></bdo><ul id='yPjxH'></ul>
              1. <small id='yPjxH'></small><noframes id='yPjxH'>

              2. <i id='yPjxH'><tr id='yPjxH'><dt id='yPjxH'><q id='yPjxH'><span id='yPjxH'><b id='yPjxH'><form id='yPjxH'><ins id='yPjxH'></ins><ul id='yPjxH'></ul><sub id='yPjxH'></sub></form><legend id='yPjxH'></legend><bdo id='yPjxH'><pre id='yPjxH'><center id='yPjxH'></center></pre></bdo></b><th id='yPjxH'></th></span></q></dt></tr></i><div id='yPjxH'><tfoot id='yPjxH'></tfoot><dl id='yPjxH'><fieldset id='yPjxH'></fieldset></dl></div>
                <legend id='yPjxH'><style id='yPjxH'><dir id='yPjxH'><q id='yPjxH'></q></dir></style></legend>

                1. <tfoot id='yPjxH'></tfoot>
                  本文介绍了如何在 Google Map Api V2 Android 中搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在开发一个 Android 应用程序并使用 GoogleMaps API v2.此应用程序到目前为止工作,但我想在地图中搜索路径:

                  I'm developing an Android application and using GoogleMaps API v2. This application works so far but I want search in the map with a path:

                  截图:

                  我的代码:

                  Position_mark = new LatLng(35.7008, 51.437);
                  map.moveCamera(CameraUpdateFactory.newLatLngZoom(Position_mark, 15));
                  map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
                  map.setOnMapClickListener(this);
                  map.setOnMapLongClickListener(this);
                  map.setOnMarkerDragListener(this);
                  

                  ...

                  @Override
                  public boolean onCreateOptionsMenu(Menu menu) {
                      //Used to put dark icons on light action bar
                  
                      mGoItem = menu.add(0, Delete_ITEM_ID, 0, null);
                      mGoItem.setIcon(R.drawable.ic_launcher)
                             .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
                  
                      SearchView searchView = 
                          new SearchView(getSupportActionBar().getThemedContext());
                      searchView.setQueryHint("Search for Places…");
                      searchView.setIconified(false);
                  
                      menu.add("Search")
                          .setIcon(R.drawable.abs__ic_search)
                          .setActionView(searchView)
                          .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
                  
                      searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
                  
                          @Override
                          public boolean onQueryTextSubmit(String newText) {
                              return true;
                          }
                  
                          /**
                           * Called when the query text is changed by the user.
                           * @param newText the new content of the query text field.
                           * @return false if the SearchView should perform the 
                           * default action of showing any suggestions if available, 
                           * true if the action was handled by the listener.
                           */
                          @Override
                          public boolean onQueryTextChange(String newText) {
                              Toast.makeText(getApplicationContext(), newText, 1).show();
                              return true;
                          }
                      });
                  
                      return true;
                  }
                  
                  @Override
                  public void onMapClick(LatLng point) {
                      // TODO Auto-generated method stub
                      // tvLocInfo.setText(point.toString());
                      map.animateCamera(CameraUpdateFactory.newLatLng(point));
                      map.clear();
                  
                      Marker Kiel = map.addMarker(new MarkerOptions()
                          .position(point)
                          .title("Kiel")
                          .snippet("Kiel is cool").draggable(true)
                          .icon(BitmapDescriptorFactory
                          .fromResource(R.drawable.ic_launcher)));
                  }
                  

                  我使用 ActionBarSherlockSearchView 进行搜索.如何在 GoogleMaps API 中搜索路径不是纬度或经度?

                  I use ActionBarSherlock and SearchView for searching. How to search in GoogleMaps API with path not latitute or longitude?

                  推荐答案

                  您可以使用地理编码来搜索或查看这个使用 json 解析 GoogleMaps 的精彩教程.

                  You can use geocoding to search or see this nice tutorial which uses json parsing GoogleMaps.

                  • 添加Google Places Autocomplete API 作为 Android 搜索对话框中的自定义建议

                  这篇关于如何在 Google Map Api V2 Android 中搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Android:getLastKnownLocation 已过期 - 如何强制刷新位置 下一篇:如何在 iOS 上的变量中获取位置(纬度和经度值)

                  相关文章

                  最新文章

                2. <legend id='4caj1'><style id='4caj1'><dir id='4caj1'><q id='4caj1'></q></dir></style></legend>

                  <small id='4caj1'></small><noframes id='4caj1'>

                3. <tfoot id='4caj1'></tfoot>

                  • <bdo id='4caj1'></bdo><ul id='4caj1'></ul>

                    1. <i id='4caj1'><tr id='4caj1'><dt id='4caj1'><q id='4caj1'><span id='4caj1'><b id='4caj1'><form id='4caj1'><ins id='4caj1'></ins><ul id='4caj1'></ul><sub id='4caj1'></sub></form><legend id='4caj1'></legend><bdo id='4caj1'><pre id='4caj1'><center id='4caj1'></center></pre></bdo></b><th id='4caj1'></th></span></q></dt></tr></i><div id='4caj1'><tfoot id='4caj1'></tfoot><dl id='4caj1'><fieldset id='4caj1'></fieldset></dl></div>