相关疑难解决方法(0)

Android - 如何使用 Intent 和 KML 打开谷歌地图?

我需要使用 sdcard 上已经存在的 kml 文件打开谷歌地图。(/sdcard/example.kml)

我试过:

这个答案是错误的,当点击链接时,地图打开,但搜索位置“file:///sdcard/example.kml”

  • 使用意图:

此代码抛出ActivityNotFoundException

Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
        Uri.parse("file:///sdcard/example.kml"));
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
  • 我尝试使用 setDataAndType 方法,但不起作用:

另一个ActivityNotFoundException

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(
         Uri.parse("file:///sdcard/example.kml"),
                   "application/kml");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
  • 关于此问题的其他两个未解决的主题:

在 Android 上的 Google 地图中打开本地 KML 文件

Android API 是否支持 KML 文件?

知道如何打开这个kml吗?

谢谢!!!

android android-intent

5
推荐指数
1
解决办法
8164
查看次数

在 Google 地图上移动和显示行车摄像头视图

我已经通过谷歌地图路由添加了当前位置

        Routing routing = new Routing.Builder()
            .travelMode(Routing.TravelMode.DRIVING)
            .key(getResources().getString(R.string.google_maps_api))
            .withListener(this)
            .waypoints(new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude()), site_location)
            .alternativeRoutes(false)
            .build();
    routing.execute();



   @Override
public void onRoutingSuccess(ArrayList<Route> route, int shortestRouteIndex) {

    if (polylines.size() > 0) {
        for (Polyline poly : polylines) {
            poly.remove();
        }
    }

    polylines = new ArrayList<>();
    //add route(s) to the map.
    for (int i = 0; i < route.size(); i++) {

        //In case of more than 5 alternative routes
        int colorIndex = i % COLORS.length;

        PolylineOptions polyOptions = new PolylineOptions();
        polyOptions.color(getResources().getColor(COLORS[colorIndex]));
        polyOptions.width(10 + i …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-maps-markers google-maps-android-api-2

5
推荐指数
2
解决办法
2927
查看次数

使用intent调用Google地图时禁止选择器对话框

我想在不显示"完整操作对话框"的情况下调用谷歌地图意图?

可能吗?这是我的代码.

String uri = "http://maps.google.com/maps?saddr=" + Utils.getLatitude(ShowDetails.this)+","+Utils.getLongitude(ShowDetails.this)+"&daddr="+userLatitude+","+userLongitude;
startActivity(new Intent(android.content.Intent.ACTION_DEFAULT, Uri.parse(uri)));
Run Code Online (Sandbox Code Playgroud)

我不想在调用谷歌地图意图时显示在下面的对话框中.任何帮助表示赞赏.

在此输入图像描述

android google-maps

4
推荐指数
2
解决办法
8948
查看次数

如何在android中以编程方式启动地图应用程序以显示方向?

我的客户要我展示两个地点之间的路线.因此他希望我们的应用程序应该启动android的地图应用程序并在两个位置之间显示方向.我找不到解决这个问题的方法.

因此,有人可以告诉我如何以编程方式从我们当前的应用程序启动地图应用程序,并在Android中的两个位置之间显示方向.

请发给我任何示例代码或教程以实现此目的.

android dictionary direction driving-directions

3
推荐指数
1
解决办法
4118
查看次数

将用户重定向到Google Maps Android应用程序以显示方向

我在Android应用程序中工作,我有两个Geo点.我希望用户从我的应用程序重定向到谷歌地图android应用程序,以显示地图中的方向.如何将两个地理位置传递到谷歌地图android应用程序以显示谷歌地图应用程序中的方向.

android google-maps android-maps android-maps-v2

3
推荐指数
1
解决办法
4692
查看次数

如何立即启动给定地址的Google Maps Navigation?

我对创建一个按钮感兴趣,该按钮将立即启动Google Maps应用并开始将导航驱动到特定地址。这可能吗?如果是这样,API是什么?

我希望它立即开始导航,而不会强迫用户在不同的路线选项之间进行选择。

android google-maps google-maps-api-3 google-maps-android-api-2 android-maps-v2

0
推荐指数
1
解决办法
869
查看次数

我想通过将纬度和经度作为目的地以及我当前的位置来显示谷歌地图

我想按纬度和经度显示谷歌地图.

然而我正在使用Address来显示Gmap.

这是我的代码:

Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(Uri.parse("geo:0,0?q=" + ("2100 California St., Eureka, CA")));
                try {
                    startActivity(intent);
                } catch (Exception e) {
                    e.printStackTrace();
                }
Run Code Online (Sandbox Code Playgroud)

我想按纬度和经度显示地图.

提前致谢.

android map

-1
推荐指数
1
解决办法
6254
查看次数