Added feature showing api for Android

This commit is contained in:
r.kuznetsov 2017-12-06 13:50:14 +03:00 committed by Ilya Grechuhin
parent 118e1a3e32
commit a09ed487f2
4 changed files with 20 additions and 0 deletions

View file

@ -1567,4 +1567,11 @@ Java_com_mapswithme_maps_Framework_nativeIsUserAuthenticated()
{
return frm()->GetUser().IsAuthenticated();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeShowFeatureByLatLon(JNIEnv * env, jclass,
jdouble lat, jdouble lon)
{
frm()->ShowFeatureByMercator(MercatorBounds::FromLatLon(ms::LatLon(lat, lon)));
}
} // extern "C"

View file

@ -384,4 +384,6 @@ public class Framework
public static native void nativeAuthenticateUser(@NonNull String socialToken,
@SocialTokenType int socialTokenType);
public static native boolean nativeIsUserAuthenticated();
public static native void nativeShowFeatureByLatLon(double lat, double lon);
}

View file

@ -1035,6 +1035,16 @@ void Framework::ShowTrack(Track const & track)
ShowRect(rect);
}
void Framework::ShowFeatureByMercator(m2::PointD const & pt)
{
place_page::Info info;
std::string name;
GetBookmarkManager().SelectionMark()->SetPtOrg(pt);
FillPointInfo(pt, name, info);
ActivateMapSelection(false, df::SelectionShape::OBJECT_POI, info);
m_lastTapEvent = MakeTapEvent(info.GetMercator(), info.GetID(), TapEvent::Source::Other);
}
void Framework::ClearBookmarks()
{
GetBookmarkManager().ClearCategories();

View file

@ -332,6 +332,7 @@ public:
void ShowBookmark(BookmarkAndCategory const & bnc);
void ShowTrack(Track const & track);
void ShowFeatureByMercator(m2::PointD const & pt);
void ClearBookmarks();