Fix scale and balloon position for exported/imported ge0 URLs.

This commit is contained in:
vng 2013-08-20 18:10:07 +03:00 committed by Alex Zolotarev
parent 5da20aaa42
commit 2f6acb337e
20 changed files with 149 additions and 101 deletions

View file

@ -583,15 +583,15 @@ namespace android
return m_work.Storage().IsDownloadInProgress();
}
bool Framework::SetViewportByUrl(string const & url)
bool Framework::SetViewportByUrl(string const & url, bool needPadding)
{
/// @todo this is weird hack, we should reconsider Android lifecycle handling design
m_doLoadState = false;
url_scheme::ApiPoint apiPoint;
if (m_work.SetViewportByURL(url, apiPoint))
url_scheme::ResultPoint point;
if (m_work.SetViewportByURL(url, point))
{
GetBalloonManager().ShowApiPoint(apiPoint);
GetBalloonManager().ShowURLPoint(point, needPadding);
return true;
}
return false;
@ -721,7 +721,8 @@ extern "C"
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_Framework_nativeGetGe0Url(JNIEnv * env, jclass clazz, jdouble lat, jdouble lon, jdouble zoomLevel, jstring name)
{
const string url = g_framework->NativeFramework()->CodeGe0url(lat, lon, zoomLevel, jni::ToNativeString(env, name));
double const scale = (zoomLevel > 0 ? zoomLevel : g_framework->NativeFramework()->GetDrawScale());
const string url = g_framework->NativeFramework()->CodeGe0url(lat, lon, scale, jni::ToNativeString(env, name));
return jni::ToJavaString(env, url);
}

View file

@ -125,7 +125,7 @@ namespace android
bool IsDownloadingActive();
bool SetViewportByUrl(string const & ulr);
bool SetViewportByUrl(string const & url, bool needPadding);
void DeactivatePopup();

View file

@ -141,8 +141,9 @@ extern "C"
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_MWMActivity_setViewPortByUrl(JNIEnv * env, jobject thiz, jstring url)
Java_com_mapswithme_maps_MWMActivity_setViewPortByUrl(JNIEnv * env, jobject thiz,
jstring url, jboolean needPadding)
{
return g_framework->SetViewportByUrl(jni::ToNativeString(env, url));
return g_framework->SetViewportByUrl(jni::ToNativeString(env, url), needPadding);
}
} // extern "C"

View file

@ -611,7 +611,7 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
@Override
public boolean processIntent(Intent intent)
{
mMapTaskToForward = new OpenUrlTask(intent.getData().toString());
mMapTaskToForward = new OpenUrlTask(intent.getData().toString(), false);
return true;
}
}
@ -627,7 +627,7 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
@Override
public boolean processIntent(Intent intent)
{
mMapTaskToForward = new OpenUrlTask(intent.getData().toString());
mMapTaskToForward = new OpenUrlTask(intent.getData().toString(), false);
return true;
}
}
@ -654,7 +654,7 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
if (data != null)
{
final String ge0Url = "ge0:/" + data.getPath();
mMapTaskToForward = new OpenUrlTask(ge0Url);
mMapTaskToForward = new OpenUrlTask(ge0Url, false);
return true;
}
else
@ -684,7 +684,7 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
Statistics.INSTANCE.trackApiCall(request);
getMwmApplication().getAppStateManager().transitionTo(SuppotedState.API_REQUEST);
mMapTaskToForward = new OpenUrlTask(apiUrl);
mMapTaskToForward = new OpenUrlTask(apiUrl, true);
return true;
}
return false;
@ -714,7 +714,7 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
final Matcher m = p.matcher(data.getQueryParameter("q"));
final String ll = m.find() ? m.group() : "0,0";
mMapTaskToForward = new OpenUrlTask("geo://" + ll);
mMapTaskToForward = new OpenUrlTask("geo://" + ll, false);
return true;
}
return false;

View file

@ -1049,17 +1049,21 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
{
private static final long serialVersionUID = 1L;
private final String mUrl;
private final boolean mPadding;
public OpenUrlTask(String url)
/// @param[in] padding Pass true only for URL's with pins on map (API), otherwise - false.
public OpenUrlTask(String url, boolean padding)
{
Utils.checkNotNull(url);
mUrl = url;
mPadding = padding;
}
@Override
public boolean run(MWMActivity target)
{
return target.setViewPortByUrl(mUrl);
return target.setViewPortByUrl(mUrl, mPadding);
}
}
@ -1147,5 +1151,5 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
private native boolean nativeIsInChina(double lat, double lon);
public native boolean setViewPortByUrl(String url);
public native boolean setViewPortByUrl(String url, boolean padding);
}

View file

@ -69,7 +69,8 @@ public class MapObjectFragment extends Fragment
//Bookmark
private int mCategory;
private int mBmkIndex;
private double mScale = MapObject.DEF_SCALE;
/// -1 means not initialized (not a bookmark) - C++ code takes Framework::GetDrawScale() for sharing.
private double mScale = -1.0;
// General
MapObjectType mType;

View file

@ -4,11 +4,10 @@ import com.mapswithme.maps.MapObjectFragment.MapObjectType;
public abstract class MapObject
{
public static double DEF_SCALE = 14.0;
public abstract double getScale();
public abstract String getName();
public abstract double getLat();
public abstract double getLon();
public abstract MapObjectType getType();
}

View file

@ -302,7 +302,7 @@ typedef enum {Editing, Saved} Mode;
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex
{
[ShareActionSheet resolveActionSheetChoice:actionSheet buttonIndex:buttonIndex text:self.pinTitle view:self delegate:self scale:GetFramework().GetDrawScale() gX:_pinGlobalPosition.x gY:_pinGlobalPosition.y andMyPosition:NO];
[ShareActionSheet resolveActionSheetChoice:actionSheet buttonIndex:buttonIndex text:self.pinTitle view:self delegate:self gX:_pinGlobalPosition.x gY:_pinGlobalPosition.y andMyPosition:NO];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error

View file

@ -68,10 +68,10 @@ void InitLocalizedStrings()
{
if (pasteboard.string.length)
{
url_scheme::ApiPoint apiPoint;
if (GetFramework().SetViewportByURL([pasteboard.string UTF8String], apiPoint))
url_scheme::ResultPoint point;
if (GetFramework().SetViewportByURL([pasteboard.string UTF8String], point))
{
[self showParsedBookmarkOnMap:apiPoint];
[self showParsedBookmarkOnMap:point withPadding:NO];
pasteboard.string = @"";
}
}
@ -185,14 +185,16 @@ void InitLocalizedStrings()
{
NSString * scheme = url.scheme;
Framework & f = GetFramework();
// geo scheme support, see http://tools.ietf.org/html/rfc5870
if ([scheme isEqualToString:@"geo"] || [scheme isEqualToString:@"ge0"])
{
url_scheme::ApiPoint apiPoint;
if (f.SetViewportByURL([url.absoluteString UTF8String], apiPoint))
url_scheme::ResultPoint point;
if (f.SetViewportByURL([url.absoluteString UTF8String], point))
{
[self showParsedBookmarkOnMap:apiPoint];
[self showParsedBookmarkOnMap:point withPadding:NO];
m_didOpenedWithUrl = YES;
if ([scheme isEqualToString:@"geo"])
[[Statistics instance] logEvent:@"geo Import"];
if ([scheme isEqualToString:@"ge0"])
@ -200,17 +202,20 @@ void InitLocalizedStrings()
return YES;
}
}
if ([scheme isEqualToString:@"mapswithme"] || [scheme isEqualToString:@"mwm"])
{
url_scheme::ApiPoint apiPoint;
url_scheme::ResultPoint apiPoint;
if (f.SetViewportByURL([url.absoluteString UTF8String], apiPoint));
{
[[Statistics instance] logApiUsage:sourceApplication];
GetFramework().GetBalloonManager().Hide();
f.GetBalloonManager().Hide();
if (f.GetMapApiPoints().size() == 1)
[self showParsedBookmarkOnMap:apiPoint];
[self showParsedBookmarkOnMap:apiPoint withPadding:YES];
else
[self showMap];
[m_mapViewController prepareForApi];
return YES;
}
@ -266,10 +271,10 @@ void InitLocalizedStrings()
[m_navController setNavigationBarHidden:YES animated:YES];
}
-(void) showParsedBookmarkOnMap:(url_scheme::ApiPoint const &) point
-(void) showParsedBookmarkOnMap:(url_scheme::ResultPoint const &) point withPadding:(BOOL) padding
{
[self showMap];
GetFramework().GetBalloonManager().ShowApiPoint(point);
GetFramework().GetBalloonManager().ShowURLPoint(point, padding == YES);
}
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated

View file

@ -204,7 +204,7 @@ typedef enum {APIPOINT, POI, MYPOSITION} Type;
else if (m_previewType == APIPOINT)
name = m_apiPoint.m_name;
BOOL const myPos = (m_previewType == MYPOSITION) ? YES : NO;
[ShareActionSheet resolveActionSheetChoice:actionSheet buttonIndex:buttonIndex text:[NSString stringWithUTF8String:name.c_str()] view:self delegate:self scale:GetFramework().GetDrawScale() gX:m_point.x gY:m_point.y andMyPosition:myPos];
[ShareActionSheet resolveActionSheetChoice:actionSheet buttonIndex:buttonIndex text:[NSString stringWithUTF8String:name.c_str()] view:self delegate:self gX:m_point.x gY:m_point.y andMyPosition:myPos];
}
-(void)addToBookmark

View file

@ -12,6 +12,6 @@
@interface ShareActionSheet : NSObject
+(void)showShareActionSheetInView:(id)view withObject:(id)del;
+(void)resolveActionSheetChoice:(UIActionSheet *)as buttonIndex:(NSInteger)buttonIndex text:(NSString *)text
view:(id)view delegate:(id)del scale:(double)scale gX:(double)gX gY:(double)gY
view:(id)view delegate:(id)del gX:(double)gX gY:(double)gY
andMyPosition:(BOOL)myPos;
@end

View file

@ -31,22 +31,23 @@
}
+(void)resolveActionSheetChoice:(UIActionSheet *)as buttonIndex:(NSInteger)buttonIndex text:(NSString *)text
view:(id)view delegate:(id)del scale:(double)scale gX:(double)gX gY:(double)gY
view:(id)view delegate:(id)del gX:(double)gX gY:(double)gY
andMyPosition:(BOOL)myPos
{
NSString * shortUrl = [self generateShortUrlWithName:text scale:scale gX:gX gY:gY];
NSString * shortUrl = [self generateShortUrlWithName:text gX:gX gY:gY];
if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"email", nil)])
[self sendEmailWith:text andUrl:shortUrl view:view delegate:del gX:gX gY:gY myPosition:myPos];
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"message", nil)])
[self sendMessageWithUrl:[shortUrl substringWithRange:NSMakeRange(0, GE0LENGTH)] view:view delegate:del myPosition:myPos];
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"copy_link", nil)])
[UIPasteboard generalPasteboard].string = [self generateShortUrlWithName:text scale:scale gX:gX gY:gY];
[UIPasteboard generalPasteboard].string = [self generateShortUrlWithName:text gX:gX gY:gY];
}
+(NSString *)generateShortUrlWithName:(NSString *)name scale:(double)scale gX:(double)gX gY:(double)gY
+(NSString *)generateShortUrlWithName:(NSString *)name gX:(double)gX gY:(double)gY
{
Framework & f = GetFramework();
string const s = f.CodeGe0url(MercatorBounds::YToLat(gY), MercatorBounds::XToLon(gX), scale, [(name ? name : @"") UTF8String]);
string const s = f.CodeGe0url(MercatorBounds::YToLat(gY), MercatorBounds::XToLon(gX),
f.GetDrawScale(), [(name ? name : @"") UTF8String]);
return [NSString stringWithUTF8String:s.c_str()];
}

View file

@ -96,12 +96,10 @@ void BalloonManager::ShowAddress(m2::PointD const & pt, search::AddressInfo cons
m_balloon->setOnClickListener(bind(&BalloonManager::OnActivatePOI, this, _1, info));
}
void BalloonManager::ShowApiPoint(url_scheme::ApiPoint const & apiPoint)
void BalloonManager::ShowURLPoint(url_scheme::ResultPoint const & point, bool needPadding)
{
Show(m2::PointD(MercatorBounds::LonToX(apiPoint.m_lon),
MercatorBounds::LatToY(apiPoint.m_lat)),
apiPoint.m_name, "", true);
m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateAPI, this, _1, apiPoint));
Show(point.GetOrg(), point.GetName(), "", needPadding);
m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateAPI, this, _1, point));
}
void BalloonManager::ShowBookmark(BookmarkAndCategory bmAndCat)
@ -113,12 +111,10 @@ void BalloonManager::ShowBookmark(BookmarkAndCategory bmAndCat)
void BalloonManager::OnClick(m2::PointD const & pxPoint, bool isLongTouch)
{
url_scheme::ApiPoint apiPoint;
url_scheme::ResultPoint apiPoint;
if (m_f.GetMapApiPoint(pxPoint, apiPoint))
{
Show(m2::PointD(MercatorBounds::LonToX(apiPoint.m_lon),
MercatorBounds::LatToY(apiPoint.m_lat)),
apiPoint.m_name, "", true);
Show(apiPoint.GetOrg(), apiPoint.GetName(), "", true);
m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateAPI, this, _1, apiPoint));
}
else
@ -177,9 +173,9 @@ void BalloonManager::OnActivatePOI(gui::Element *, search::AddressInfo const & i
m_poiListener(m_balloon->glbPivot(), info);
}
void BalloonManager::OnActivateAPI(gui::Element *, url_scheme::ApiPoint const & apiPoint)
void BalloonManager::OnActivateAPI(gui::Element *, url_scheme::ResultPoint const & apiPoint)
{
m_apiListener(apiPoint);
m_apiListener(apiPoint.GetPoint());
}
void BalloonManager::OnActivateBookmark(gui::Element *, BookmarkAndCategory const & bmAndCat)

View file

@ -14,7 +14,11 @@ class BookmarkBalloon;
namespace location { class GpsInfo; }
namespace gui { class Element; }
namespace search { struct AddressInfo; }
namespace url_scheme { struct ApiPoint; }
namespace url_scheme
{
struct ApiPoint;
class ResultPoint;
}
class BalloonManager
{
@ -27,7 +31,7 @@ class BalloonManager
void OnPositionClicked(m2::PointD const & pt);
void OnActivateMyPosition(gui::Element *);
void OnActivatePOI(gui::Element *, search::AddressInfo const & info);
void OnActivateAPI(gui::Element *, url_scheme::ApiPoint const & apiPoint);
void OnActivateAPI(gui::Element *, url_scheme::ResultPoint const & apiPoint);
void OnActivateBookmark(gui::Element *, BookmarkAndCategory const & bmAndCat);
void Show(m2::PointD const & pt, string const & name, string const & type, bool needPadding);
@ -40,7 +44,7 @@ public:
void ScreenSizeChanged(int width, int height);
void ShowAddress(m2::PointD const & pt, search::AddressInfo const & info);
void ShowApiPoint(url_scheme::ApiPoint const & apiPoint);
void ShowURLPoint(url_scheme::ResultPoint const & point, bool needPadding);
void ShowBookmark(BookmarkAndCategory bmAndCat);
void OnClick(m2::PointD const & pxPoint, bool isLongTouch);

View file

@ -1376,7 +1376,14 @@ void Framework::AddBookmarkAndSetViewport(Bookmark & bm, m2::RectD const & viewP
}
*/
bool Framework::SetViewportByURL(string const & url, url_scheme::ApiPoint & balloonPoint)
void Framework::CheckParams(url_scheme::ResultPoint & point) const
{
string & name = point.GetName();
if (name.empty())
name = m_stringsBundle.GetString("dropped_pin");
}
bool Framework::SetViewportByURL(string const & url, url_scheme::ResultPoint & point)
{
if (strings::StartsWith(url, "geo"))
{
@ -1384,29 +1391,30 @@ bool Framework::SetViewportByURL(string const & url, url_scheme::ApiPoint & ball
Info info;
ParseGeoURL(url, info);
if (info.IsValid())
{
StopLocationFollow();
balloonPoint.m_name = m_stringsBundle.GetString("dropped_pin");
balloonPoint.m_lat = info.m_lat;
balloonPoint.m_lon = info.m_lon;
SetViewPortASync(info.GetViewport());
point.MakeFrom(info.m_lat, info.m_lon);
CheckParams(point);
SetViewPortASync(m_scales.GetRectForDrawScale(info.m_zoom, point.GetOrg()));
return true;
}
}
else if (strings::StartsWith(url, "ge0"))
{
StopLocationFollow();
url_scheme::Ge0Parser parser;
double zoomLevel;
if (parser.Parse(url, balloonPoint, zoomLevel))
{
if (balloonPoint.m_name.empty())
balloonPoint.m_name = m_stringsBundle.GetString("dropped_pin");
m2::PointD const center(MercatorBounds::LonToX(balloonPoint.m_lon), MercatorBounds::LatToY(balloonPoint.m_lat));
SetViewPortASync(m_scales.GetRectForDrawScale(zoomLevel, center));
url_scheme::Ge0Parser parser;
double zoom;
url_scheme::ApiPoint pt;
if (parser.Parse(url, pt, zoom))
{
point.MakeFrom(pt);
CheckParams(point);
SetViewPortASync(m_scales.GetRectForDrawScale(zoom, point.GetOrg()));
return true;
}
}
@ -1415,16 +1423,17 @@ bool Framework::SetViewportByURL(string const & url, url_scheme::ApiPoint & ball
if (m_ParsedMapApi.SetUriAndParse(url))
{
StopLocationFollow();
// Can do better consider nav bar size
SetViewPortASync(GetMapApiViewportRect());
if (!m_ParsedMapApi.GetPoints().empty())
{
balloonPoint = m_ParsedMapApi.GetPoints().front();
point.MakeFrom(m_ParsedMapApi.GetPoints().front());
return true;
}
}
}
return false;
}
@ -1558,14 +1567,14 @@ StringsBundle const & Framework::GetStringsBundle()
return m_stringsBundle;
}
string Framework::CodeGe0url(Bookmark const * bmk, bool const addName)
string Framework::CodeGe0url(Bookmark const * bmk, bool addName)
{
double lat = MercatorBounds::YToLat(bmk->GetOrg().y);
double lon = MercatorBounds::XToLon(bmk->GetOrg().x);
return CodeGe0url(lat, lon, bmk->GetScale(), addName ? bmk->GetName() : "");
}
string Framework::CodeGe0url(double const lat, double const lon, double const zoomLevel, string const & name)
string Framework::CodeGe0url(double lat, double lon, double zoomLevel, string const & name)
{
size_t const resultSize = MapsWithMe_GetMaxBufferSize(name.size());
@ -1599,7 +1608,7 @@ void Framework::DrawMapApiPoints(shared_ptr<PaintEvent> const & e)
}
/// @todo Create method that will run all layers without copy/past
bool Framework::GetMapApiPoint(m2::PointD const & pxPoint, url_scheme::ApiPoint & point)
bool Framework::GetMapApiPoint(m2::PointD const & pxPoint, url_scheme::ResultPoint & point)
{
m2::AnyRectD rect;
m_navigator.GetTouchRect(pxPoint, TOUCH_PIXEL_RADIUS * GetVisualScale(), rect);
@ -1608,23 +1617,24 @@ bool Framework::GetMapApiPoint(m2::PointD const & pxPoint, url_scheme::ApiPoint
double minD = numeric_limits<double>::max();
bool result = false;
vector <url_scheme::ApiPoint> const & vect = m_ParsedMapApi.GetPoints();
for (size_t i = 0; i < vect.size();++i)
vector<url_scheme::ApiPoint> const & v = m_ParsedMapApi.GetPoints();
for (size_t i = 0; i < v.size(); ++i)
{
m2::PointD const pt = m2::PointD(m2::PointD(MercatorBounds::LonToX(vect[i].m_lon),
MercatorBounds::LatToY(vect[i].m_lat)));
if (rect.IsPointInside(pt))
url_scheme::ResultPoint pt;
pt.MakeFrom(v[i]);
if (rect.IsPointInside(pt.GetOrg()))
{
double const d = center.SquareLength(pt);
double const d = center.SquareLength(pt.GetOrg());
if (d < minD)
{
point = vect[i];
point = pt;
minD = d;
result = true;
}
}
}
return result;
}

View file

@ -313,8 +313,9 @@ public:
m2::PointD GetViewportCenter() const;
void SetViewportCenter(m2::PointD const & pt);
/// @param[out] outPoint is a point in url, where we need to show balloon
bool SetViewportByURL(string const & url, url_scheme::ApiPoint & balloonPoint);
/// @param[out] point is a point in url, where we need to show balloon
void CheckParams(url_scheme::ResultPoint & point) const;
bool SetViewportByURL(string const & url, url_scheme::ResultPoint & point);
bool NeedRedraw() const;
void SetNeedRedraw(bool flag);
@ -445,8 +446,8 @@ public:
shared_ptr<location::State> const & GetLocationState() const;
public:
string CodeGe0url(Bookmark const * bmk, bool const addName);
string CodeGe0url(double const lat, double const lon, double const zoomLevel, string const & name);
string CodeGe0url(Bookmark const * bmk, bool addName);
string CodeGe0url(double lat, double lon, double zoomLevel, string const & name);
/// @name Api
//@{
@ -456,7 +457,8 @@ private:
void SetViewPortASync(m2::RectD const & rect);
public:
bool GetMapApiPoint(m2::PointD const & pxPoint, url_scheme::ApiPoint & point);
bool GetMapApiPoint(m2::PointD const & pxPoint, url_scheme::ResultPoint & point);
vector<url_scheme::ApiPoint> const & GetMapApiPoints() { return m_ParsedMapApi.GetPoints(); }
void ClearMapApiPoints() { m_ParsedMapApi.Reset(); }
int GetMapApiVersion() const { return m_ParsedMapApi.GetApiVersion(); }

View file

@ -19,18 +19,6 @@ namespace url_scheme
m_zoom = scales::GetUpperScale();
}
m2::RectD Info::GetViewport() const
{
ASSERT ( IsValid(), () );
return scales::GetRectForLevel(m_zoom, GetMercatorPoint(), 1.0);
}
m2::PointD Info::GetMercatorPoint() const
{
return m2::PointD(MercatorBounds::LonToX(m_lon), MercatorBounds::LatToY(m_lat));
}
class DoGeoParse
{
Info & m_info;

View file

@ -18,10 +18,6 @@ namespace url_scheme
{
Reset();
}
m2::RectD GetViewport() const;
/// @return lat and lon in Mercator projection
m2::PointD GetMercatorPoint() const;
};
void ParseGeoURL(string const & s, Info & info);

View file

@ -12,7 +12,14 @@
#include "../std/bind.hpp"
using namespace url_scheme;
namespace url_scheme
{
void ResultPoint::Init()
{
m_org = m2::PointD(MercatorBounds::LonToX(m_point.m_lon),
MercatorBounds::LatToY(m_point.m_lat));
}
namespace
{
@ -172,3 +179,5 @@ bool ParsedMapApi::GetViewportRect(m2::RectD & rect) const
else
return false;
}
}

View file

@ -1,6 +1,8 @@
#include "../geometry/rect2d.hpp"
#include "../std/string.hpp"
namespace url_scheme
{
@ -14,6 +16,35 @@ struct ApiPoint
string m_id;
};
class ResultPoint
{
ApiPoint m_point;
m2::PointD m_org;
void Init();
public:
void MakeFrom(double lat, double lon)
{
m_point.m_lat = lat;
m_point.m_lon = lon;
Init();
}
void MakeFrom(url_scheme::ApiPoint const & pt)
{
m_point = pt;
Init();
}
/// Need to fix default name using "dropped_pin" in Framework.
string & GetName() { return m_point.m_name; }
m2::PointD GetOrg() const { return m_org; }
string const & GetName() const { return m_point.m_name; }
ApiPoint const & GetPoint() const { return m_point; }
};
/// Handles [mapswithme|mwm]://map?params - everything related to displaying info on a map
class ParsedMapApi
{