-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support map view without navigation (#259)
Co-authored-by: Joonas Kerttula <[email protected]>
- Loading branch information
1 parent
b182d14
commit 15fd94b
Showing
21 changed files
with
1,179 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
android/src/main/java/com/google/android/react/navsdk/CustomTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
* except in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* <p>http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* <p>Unless required by applicable law or agreed to in writing, software distributed under the | ||
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.android.react.navsdk; | ||
|
||
public class CustomTypes { | ||
public enum FragmentType { | ||
MAP, | ||
NAVIGATION | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
android/src/main/java/com/google/android/react/navsdk/IMapViewFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
* except in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* <p>http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* <p>Unless required by applicable law or agreed to in writing, software distributed under the | ||
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.android.react.navsdk; | ||
|
||
import android.view.View; | ||
import com.google.android.gms.maps.GoogleMap; | ||
import com.google.android.gms.maps.model.Circle; | ||
import com.google.android.gms.maps.model.GroundOverlay; | ||
import com.google.android.gms.maps.model.Marker; | ||
import com.google.android.gms.maps.model.Polygon; | ||
import com.google.android.gms.maps.model.Polyline; | ||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
public interface IMapViewFragment { | ||
void setStylingOptions(Map stylingOptions); | ||
|
||
void applyStylingOptions(); | ||
|
||
void setFollowingPerspective(int jsValue); | ||
|
||
void setNightModeOption(int jsValue); | ||
|
||
void setMapType(int jsValue); | ||
|
||
void clearMapView(); | ||
|
||
void resetMinMaxZoomLevel(); | ||
|
||
void animateCamera(Map map); | ||
|
||
Circle addCircle(Map optionsMap); | ||
|
||
Marker addMarker(Map optionsMap); | ||
|
||
Polyline addPolyline(Map optionsMap); | ||
|
||
Polygon addPolygon(Map optionsMap); | ||
|
||
void removeMarker(String id); | ||
|
||
void removePolyline(String id); | ||
|
||
void removePolygon(String id); | ||
|
||
void removeCircle(String id); | ||
|
||
void removeGroundOverlay(String id); | ||
|
||
GroundOverlay addGroundOverlay(Map map); | ||
|
||
void setMapStyle(String url); | ||
|
||
String fetchJsonFromUrl(String urlString) throws IOException; | ||
|
||
void moveCamera(Map map); | ||
|
||
void setZoomLevel(int level); | ||
|
||
void setIndoorEnabled(boolean isOn); | ||
|
||
void setTrafficEnabled(boolean isOn); | ||
|
||
void setCompassEnabled(boolean isOn); | ||
|
||
void setRotateGesturesEnabled(boolean isOn); | ||
|
||
void setScrollGesturesEnabled(boolean isOn); | ||
|
||
void setScrollGesturesEnabledDuringRotateOrZoom(boolean isOn); | ||
|
||
void setTiltGesturesEnabled(boolean isOn); | ||
|
||
void setZoomControlsEnabled(boolean isOn); | ||
|
||
void setZoomGesturesEnabled(boolean isOn); | ||
|
||
void setBuildingsEnabled(boolean isOn); | ||
|
||
void setMyLocationEnabled(boolean isOn); | ||
|
||
void setMapToolbarEnabled(boolean isOn); | ||
|
||
void setMyLocationButtonEnabled(boolean isOn); | ||
|
||
GoogleMap getGoogleMap(); | ||
|
||
// Fragment | ||
boolean isAdded(); | ||
|
||
View getView(); | ||
} |
34 changes: 34 additions & 0 deletions
34
android/src/main/java/com/google/android/react/navsdk/INavViewFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
* except in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* <p>http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* <p>Unless required by applicable law or agreed to in writing, software distributed under the | ||
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.android.react.navsdk; | ||
|
||
public interface INavViewFragment extends IMapViewFragment { | ||
void setNavigationUiEnabled(boolean enableNavigationUi); | ||
|
||
void setTripProgressBarEnabled(boolean enabled); | ||
|
||
void setSpeedometerEnabled(boolean enabled); | ||
|
||
void setSpeedLimitIconEnabled(boolean enabled); | ||
|
||
void setTrafficIncidentCardsEnabled(boolean enabled); | ||
|
||
void setEtaCardEnabled(boolean enabled); | ||
|
||
void setHeaderEnabled(boolean enabled); | ||
|
||
void setRecenterButtonEnabled(boolean enabled); | ||
|
||
void showRouteOverview(); | ||
} |
Oops, something went wrong.