mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
maps intent: preserve zoom and show red pin (#6160)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
41170d81d9
commit
e01ecb20fa
5 changed files with 36 additions and 13 deletions
|
|
@ -148,13 +148,27 @@ public class Utils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Util function to handle geo coordinates
|
||||
* It no longer depends on google maps and any app capable of handling the map intent can handle it
|
||||
* @param context
|
||||
* @param latLng
|
||||
* Util function to handle geo coordinates. It no longer depends on google maps and any app
|
||||
* capable of handling the map intent can handle it
|
||||
*
|
||||
* @param context The context for launching intent
|
||||
* @param latLng The latitude and longitude of the location
|
||||
*/
|
||||
public static void handleGeoCoordinates(Context context, LatLng latLng) {
|
||||
Intent mapIntent = new Intent(Intent.ACTION_VIEW, latLng.getGmmIntentUri());
|
||||
public static void handleGeoCoordinates(final Context context, final LatLng latLng) {
|
||||
handleGeoCoordinates(context, latLng, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Util function to handle geo coordinates with specified zoom level. It no longer depends on
|
||||
* google maps and any app capable of handling the map intent can handle it
|
||||
*
|
||||
* @param context The context for launching intent
|
||||
* @param latLng The latitude and longitude of the location
|
||||
* @param zoomLevel The zoom level
|
||||
*/
|
||||
public static void handleGeoCoordinates(final Context context, final LatLng latLng,
|
||||
final double zoomLevel) {
|
||||
final Intent mapIntent = new Intent(Intent.ACTION_VIEW, latLng.getGmmIntentUri(zoomLevel));
|
||||
if (mapIntent.resolveActivity(context.getPackageManager()) != null) {
|
||||
context.startActivity(mapIntent);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue