Tag: 谷歌地图

GoogleMaps SDK for iOS上有标记animation吗?

有没有可能在GMSMapView用animation移动/旋转GMSMarker ?

如何打开Goog​​le地图来显示使用Swift的路线

我在互联网上阅读,但无法find合理的答案。 当用户点击一个button来显示路线时,我需要打开Goog​​le地图。 开始和目的地必须自动填写。 我怎样才能在Swift中实现这一点? 如果有人有解决scheme,请给我一个示例代码。 开始始终是用户的当前位置。

更新到IOS11和Xcode9后的问题! “com.google.Maps.LabelingBehavior”,“TIC Read Status”

我已经更新了手机和Xcode到最新的更新,我收到了很多警告。 第一个是2017-09-21 00:23:15.669466+0100 The Kallos[12068:1279021] TIC Read Status [1:0x0]: 1:57 而且从字面上看有2-3个关于这个的post甚至没有解释它是什么! 这是另一个警告,我find了一个类似的post,解释了这个问题,但它没有给出解决办法如何解决它! Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] PID: x, TID: x, Thread name: com.google.Maps.LabelingBehavior, Queue name: com.apple.root.default-qos.overcommit, QoS: 21 Backtrace: 4 The Kallos 0x0000000105d1e4f4 GMSIsApplicationInBackground + 53 5 The Kallos 0x0000000105d0c74a -[GMSForegroundDispatchQueue initWithName:targetQueue:] + 269 6 The Kallos […]

使用地图应用程序iOS生成步行路线

截至目前,我使用以下代码从我的应用程序成功地使用地图应用程序生成路线: NSString *formattedGroceryAddress = [[NSString stringWithFormat:@"%@",((EnhancedUIActionSheet *)actionSheet).grocery.address] stringByReplacingOccurrencesOfString:@" " withString:@"+"]; NSString *routeString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",localDataHelper.userLocation.coordinate.latitude,localDataHelper.userLocation.coordinate.longitude,formattedGroceryAddress]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:routeString]]; 它会根据适当的驾驶路线打开地图应用程序。 事情是,我想打开地图默认步行方向。 也许我可以在我的请求中传递另一个参数来做到这一点。 任何人都知道如何? 谢谢 !

iOS,如何使用GMSCoordinateBounds显示地图的所有标记?

我想显示在我的地图上的所有标记,做了一些search后,我发现它应该与GMSCoordinateBounds (谷歌地图SDK)完成我已阅读有关它的官方文档,但我不知道如何使用它并在我的代码中实现它。 https://developers.google.com/maps/documentation/ios/reference/interface_g_m_s_camera_update#aa5b05606808272f9054c54af6830df3e 这是我的代码 GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] init]; CLLocationCoordinate2D location; for (NSDictionary *dictionary in array) { location.latitude = [dictionary[@"latitude"] floatValue]; location.longitude = [dictionary[@"longitude"] floatValue]; // Creates a marker in the center of the map. GMSMarker *marker = [[GMSMarker alloc] init]; marker.icon = [UIImage imageNamed:(@"marker.png")]; marker.position = CLLocationCoordinate2DMake(location.latitude, location.longitude); bounds = [bounds includingCoordinate:marker.position]; marker.title […]

如何获得国家特定的结果与谷歌自动完成的地方api ios sdk?

我使用下面的方法来获取GMSPlacesClient类的inputstring的自动完成结果: – (void)autocompleteQuery:(NSString *)query bounds:(GMSCoordinateBounds * GMS_NULLABLE_PTR)bounds filter:(GMSAutocompleteFilter * GMS_NULLABLE_PTR)filter callback:(GMSAutocompletePredictionsCallback)callback 我试图通过多种方式来实现边界,但没有一个工作,我不知道是否有任何标准的方法来获得与GMSCoordinateBounds国家特定的结果?

适用于iOS的GoogleMaps SDK – SWIFT 3:当隐藏标记,然后添加地图视图时,cpu陷入100%

脚本 UIViewController在viewDidLload中将GMSMapView设置为GMSMapView 一个方法将创build标记并将其存储在self.markers ,并将marker.map设置为marker.map self.view as! GMSMapView self.view as! GMSMapView 到目前为止,该应用程序performance良好 稍后,另一种方法(查看切换这些标记)将所有self.markers.map设置nil 到这里一切顺利,标记从地图上消失 再一次,希望这些标记返回的另一种方法,将所有self.markers.map = self.view as! GMSMapView设置self.markers.map = self.view as! GMSMapView self.markers.map = self.view as! GMSMapView 这里的CPU卡在100%(在8核心机器模拟器上) 如果self.markers.map被重置nil ,则CPU会回到self.markers.map %,并且都是好的。 题 这是对cpu或GoogleMaps SDK的限制吗? 有没有办法避免这个问题? 重现步骤 在提取相关的代码之后,我也添加了类似的条件,其中标签被创build为另一个标记的图标。 经过一些testing后,似乎只与处理标记的数量有关。 看到LabelCount并设置为不同的值,在我的CPU中,问题出现在200,但没有100标记(即:400标记,因为有一个额外的标记标记) 示例代码 import UIKit import GoogleMaps class ViewController: UIViewController { // The problem is noticed when markers […]

是否可以显示多个标记的多个信息窗口而不用点击它?

我想在Google地图中显示多个标记的多个信息窗口。 信息窗口应该显示而不用点击标记本身。 可能吗? 经过研究,我了解到,将标记设置为mapview选定的标记可以使信息窗口出现而不用点击它。 但是,一次不能select多个标记作为mapview的选定标记。 有什么可以做的吗?

无法在ios中使用Google map sdk

我正在开发一个简单的iOS应用程序,并将其集成到Google地图中。 但没有得到任何结果。 我已经使用这个步骤 第一步 :我已经从这个链接sdk ios下载了Google Maps Mobile SDK 第2步:在Google API控制台中创build一个API项目。 第3步:selectAPI项目中的“服务”窗格,然后启用Google Maps SDK for iOS。 这显示了Google地图服务条款。 获取有效状态Google API控制台。 步骤4:i在控制台中select“API访问”窗格,然后单击“创build新的iOS密钥”。 然后我像这样在AppDelegate.m中添加了API Key #import "AppDelegate.h" #import <GoogleMapsM4B/GoogleMaps.h> @interface AppDelegate () @end @implementation AppDelegate – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. NSLog(@"Current identifier: %@", [[NSBundle mainBundle] bundleIdentifier]); [GMSServices provideAPIKey:@"AIzaSTyurcyzpvoRv3gCPJRiw7Dc6dXkTMfOI2w"]; return […]

从Google Places API获取数据后获取状态“REQUEST_DENIED”

我已经这样做了 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search/json?location=30.722322,76.76126&radius=500&types=food&sensor=true&key=any_apiKey"]]; NSURLResponse *response; NSError *error; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *strResponse = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; NSLog(@"%@",strResponse); SBJSON *sbJason = [[SBJSON alloc] init]; NSMutableDictionary *getPlaceList = [sbJason objectWithString:strResponse]; //但是我得到这个 – { "html_attributions" : [], "results" : [], "status" : "REQUEST_DENIED" } **是否有任何问题与API密钥我写了谷歌地图给出的API密钥。 是否有任何问题的API键或什么请告诉我这里是谷歌API的链接