initial attempt at panoramax layer

Signed-off-by: zyphlar <zyphlar@gmail.com>
This commit is contained in:
zyphlar
2026-01-03 16:44:29 -08:00
parent 899df496ba
commit 5eeeaeb288
20 changed files with 192 additions and 3 deletions

View File

@@ -74,6 +74,11 @@ public class PlacePageButtonFactory
titleId = R.string.avoid_ferry;
yield R.drawable.ic_avoid_ferry;
}
case PANORAMAX ->
{
titleId = R.string.panoramax;
yield R.drawable.ic_camera;
}
case MORE ->
{
titleId = R.string.placepage_more_button;

View File

@@ -144,6 +144,7 @@ public final class PlacePageButtons extends Fragment implements Observer<List<Pl
ROUTE_AVOID_TOLL,
ROUTE_AVOID_FERRY,
ROUTE_AVOID_UNPAVED,
PANORAMAX,
MORE
}

View File

@@ -428,6 +428,7 @@ public class PlacePageController
case ROUTE_AVOID_TOLL -> onAvoidTollBtnClicked();
case ROUTE_AVOID_UNPAVED -> onAvoidUnpavedBtnClicked();
case ROUTE_AVOID_FERRY -> onAvoidFerryBtnClicked();
case PANORAMAX -> onPanoramaxBtnClicked();
}
}
@@ -499,6 +500,19 @@ public class PlacePageController
requireActivity().finish();
}
private void onPanoramaxBtnClicked()
{
if (mMapObject == null)
return;
String url = Framework.nativeGetPanoramaxUrl();
if (!TextUtils.isEmpty(url))
{
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse(url));
startActivity(intent);
}
}
private void onRouteFromBtnClicked()
{
if (mMapObject == null)
@@ -637,6 +651,10 @@ public class PlacePageController
buttons.add(mapObject.isBookmark() ? PlacePageButtons.ButtonType.BOOKMARK_DELETE
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
}
// Add Panoramax button if imagery is available
if (Framework.nativeHasPanoramax())
buttons.add(PlacePageButtons.ButtonType.PANORAMAX);
}
mViewModel.setCurrentButtons(buttons);
}

View File

@@ -1764,6 +1764,16 @@ JNIEXPORT jboolean JNICALL Java_app_organicmaps_sdk_Framework_nativeHasPlacePage
return static_cast<jboolean>(frm()->HasPlacePageInfo());
}
JNIEXPORT jboolean JNICALL Java_app_organicmaps_sdk_Framework_nativeHasPanoramax(JNIEnv *, jclass)
{
return static_cast<jboolean>(g_framework->GetPlacePageInfo().HasPanoramax());
}
JNIEXPORT jstring JNICALL Java_app_organicmaps_sdk_Framework_nativeGetPanoramaxUrl(JNIEnv * env, jclass)
{
return jni::ToJavaString(env, g_framework->GetPlacePageInfo().GetPanoramaxUrl());
}
JNIEXPORT void JNICALL Java_app_organicmaps_sdk_Framework_nativeMemoryWarning(JNIEnv *, jclass)
{
return frm()->MemoryWarning();

View File

@@ -349,6 +349,8 @@ public class Framework
* @return true if c++ framework has initialized internal place page object, otherwise - false.
*/
public static native boolean nativeHasPlacePageInfo();
public static native boolean nativeHasPanoramax();
public static native String nativeGetPanoramaxUrl();
public static native void nativeMemoryWarning();
public static native void nativeSaveRoute();