|
11 | 11 | * express or implied. See the License for the specific language governing permissions and |
12 | 12 | * limitations under the License. |
13 | 13 | */ |
14 | | - |
15 | 14 | package com.google.android.react.navsdk; |
16 | 15 |
|
17 | | -import com.facebook.react.bridge.UiThreadUtil; |
18 | 16 | import android.Manifest.permission; |
19 | 17 | import android.annotation.SuppressLint; |
20 | 18 | import android.content.pm.PackageManager; |
21 | 19 | import android.graphics.Color; |
22 | 20 | import android.location.Location; |
23 | 21 | import android.os.Bundle; |
24 | | -import android.util.Log; |
25 | 22 | import android.view.LayoutInflater; |
26 | 23 | import android.view.View; |
27 | 24 | import android.view.ViewGroup; |
28 | 25 | import androidx.annotation.NonNull; |
29 | 26 | import androidx.annotation.Nullable; |
30 | | -import androidx.appcompat.app.AppCompatActivity; |
31 | 27 | import androidx.core.app.ActivityCompat; |
32 | 28 | import androidx.fragment.app.Fragment; |
33 | 29 | import androidx.lifecycle.Observer; |
34 | | - |
35 | 30 | import com.facebook.react.bridge.ReadableArray; |
| 31 | +import com.facebook.react.bridge.UiThreadUtil; |
36 | 32 | import com.google.android.gms.maps.CameraUpdateFactory; |
37 | 33 | import com.google.android.gms.maps.GoogleMap; |
38 | 34 | import com.google.android.gms.maps.OnMapReadyCallback; |
39 | | -import com.google.android.gms.maps.UiSettings; |
40 | 35 | import com.google.android.gms.maps.model.BitmapDescriptor; |
41 | 36 | import com.google.android.gms.maps.model.BitmapDescriptorFactory; |
42 | 37 | import com.google.android.gms.maps.model.CameraPosition; |
43 | 38 | import com.google.android.gms.maps.model.Circle; |
44 | | -import com.google.android.gms.maps.model.Marker; |
45 | | -import com.google.android.gms.maps.model.Polygon; |
46 | | -import com.google.android.gms.maps.model.Polyline; |
47 | | -import com.google.android.gms.maps.model.GroundOverlay; |
48 | 39 | import com.google.android.gms.maps.model.CircleOptions; |
| 40 | +import com.google.android.gms.maps.model.GroundOverlay; |
49 | 41 | import com.google.android.gms.maps.model.GroundOverlayOptions; |
50 | 42 | import com.google.android.gms.maps.model.LatLng; |
51 | 43 | import com.google.android.gms.maps.model.MapStyleOptions; |
| 44 | +import com.google.android.gms.maps.model.Marker; |
52 | 45 | import com.google.android.gms.maps.model.MarkerOptions; |
| 46 | +import com.google.android.gms.maps.model.Polygon; |
53 | 47 | import com.google.android.gms.maps.model.PolygonOptions; |
| 48 | +import com.google.android.gms.maps.model.Polyline; |
54 | 49 | import com.google.android.gms.maps.model.PolylineOptions; |
55 | 50 | import com.google.android.libraries.mapsplatform.turnbyturn.model.NavInfo; |
56 | 51 | import com.google.android.libraries.navigation.ArrivalEvent; |
|
61 | 56 | import com.google.android.libraries.navigation.Navigator; |
62 | 57 | import com.google.android.libraries.navigation.RoadSnappedLocationProvider; |
63 | 58 | import com.google.android.libraries.navigation.RoadSnappedLocationProvider.LocationListener; |
64 | | -import com.google.android.libraries.navigation.RouteSegment; |
65 | | -import com.google.android.libraries.navigation.RoutingOptions; |
66 | 59 | import com.google.android.libraries.navigation.SimulationOptions; |
67 | 60 | import com.google.android.libraries.navigation.SpeedAlertOptions; |
68 | 61 | import com.google.android.libraries.navigation.SpeedAlertSeverity; |
69 | 62 | import com.google.android.libraries.navigation.StylingOptions; |
70 | 63 | import com.google.android.libraries.navigation.SupportNavigationFragment; |
71 | 64 | import com.google.android.libraries.navigation.TermsAndConditionsCheckOption; |
72 | | -import com.google.android.libraries.navigation.TimeAndDistance; |
73 | 65 | import com.google.android.libraries.navigation.Waypoint; |
74 | | - |
75 | | -import org.json.JSONArray; |
76 | | -import org.json.JSONException; |
77 | | -import org.json.JSONObject; |
78 | | - |
79 | 66 | import java.io.BufferedReader; |
80 | 67 | import java.io.IOException; |
81 | 68 | import java.io.InputStream; |
82 | 69 | import java.io.InputStreamReader; |
83 | 70 | import java.net.HttpURLConnection; |
84 | 71 | import java.net.URL; |
85 | 72 | import java.util.ArrayList; |
86 | | -import java.util.HashMap; |
87 | 73 | import java.util.List; |
88 | 74 | import java.util.Map; |
89 | | -import java.util.UUID; |
90 | 75 | import java.util.concurrent.Executors; |
91 | 76 |
|
92 | 77 | /** |
@@ -739,6 +724,14 @@ public void onInfoWindowClick(Marker marker) { |
739 | 724 | navigationCallback.onMarkerInfoWindowTapped(marker); |
740 | 725 | } |
741 | 726 | }); |
| 727 | + |
| 728 | + mGoogleMap.setOnMapClickListener( |
| 729 | + new GoogleMap.OnMapClickListener() { |
| 730 | + @Override |
| 731 | + public void onMapClick(LatLng latLng) { |
| 732 | + navigationCallback.onMapClick(latLng); |
| 733 | + } |
| 734 | + }); |
742 | 735 | } |
743 | 736 | }); |
744 | 737 |
|
|
0 commit comments