小编And*_*ast的帖子

Android绘制折线与谷歌地图上的箭头与方向路径

我添加了折线,但无法在谷歌地图上添加带方向的箭头,应显示如下 在此输入图像描述

当它放大时,应该显示更多箭头,如下所示 在此输入图像描述

我曾尝试阅读各种博客和代码,但无法实现目标

我在下面使用了以下代码片段:

private void DrawArrowHead(MarkerOptions MO, GoogleMap mMap, LatLng from, LatLng to) {
        // obtain the bearing between the last two points
        double bearing = GetBearing(from, to);

        // round it to a multiple of 3 and cast out 120s
        double adjBearing = Math.round(bearing / 3) * 3;
        while (adjBearing >= 120) {
            adjBearing -= 120;
        }

        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);

        // Get the corresponding triangle marker from Google
        URL url;
        Bitmap image = null;

        try { …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-directions-api google-polyline google-maps-android-api-2

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

无法解析com.google.android.gms:play-services-add:11.6.0

我正在尝试将移动广告SDK集成到我的个人应用中.但是,我failed to resolve com.google.android.gms:play-services-add:11.6.0在同步模块时遇到错误:app Gradle.请帮我解决这个问题.在此输入图像描述

android admob android-gradle-plugin google-admob

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