[ios] review fix

This commit is contained in:
Arsentiy Milchakov 2019-01-14 10:16:09 +03:00 committed by Roman Kuznetsov
parent 4f85c45bcd
commit 9ef981f67b
3 changed files with 18 additions and 6 deletions

View file

@ -34,6 +34,8 @@
- (void)showRemoveAds;
- (void)setPlacePageTopBound:(CGFloat)bound;
+ (void)setViewport:(double)lat lon:(double)lon zoomLevel:(int)zoomlevel;
- (void)initialize;
@property(nonatomic, readonly) MWMMapViewControlsManager * controlsManager;

View file

@ -23,6 +23,8 @@
#include "drape_frontend/user_event_stream.hpp"
#include "geometry/mercator.hpp"
#import <Crashlytics/Crashlytics.h>
// If you have a "missing header error" here, then please run configure.sh script in the root repo
@ -745,10 +747,20 @@ BOOL gIsFirstMyPositionMode = YES;
return _downloadDialog;
}
- (void)setPlacePageTopBound:(CGFloat)bound;
- (void)setPlacePageTopBound:(CGFloat)bound
{
self.visibleAreaBottom.constant = bound;
self.sideButtonsAreaBottom.constant = bound;
}
+ (void)setViewport:(double)lat lon:(double)lon zoomLevel:(int)zoomLevel
{
Framework & f = GetFramework();
f.StopLocationFollow();
auto const center = MercatorBounds::FromLatLon(lat, lon);
f.SetViewportCenter(center, zoomLevel);
}
@end

View file

@ -39,8 +39,6 @@
#include "platform/http_thread_apple.h"
#include "platform/local_country_file_utils.hpp"
#include "geometry/mercator.hpp"
#include "base/assert.hpp"
#include "private.h"
@ -271,9 +269,9 @@ using namespace osm_auth_ios;
if (request.m_isSearchOnMap)
{
ASSERT([self isDrapeEngineCreated], ());
f.StopLocationFollow();
auto const center = MercatorBounds::FromLatLon(request.m_centerLat, request.m_centerLon);
f.SetViewportCenter(center, kSearchInViewportZoom);
[MapViewController setViewport:request.m_centerLat
lon:request.m_centerLon
zoomLevel:kSearchInViewportZoom];
[manager searchTextOnMap:query forInputLocale:locale];
}
else