当前场景 我需要一个关于谷歌地图的解决方案,目前我能够通过 url 和 sdk 打开谷歌地图我想在我通过浏览器打开它的同时在谷歌地图的标记上填充标题。
NSString *url = [[NSString alloc]initWithFormat:@"http://maps.googleapis.com/maps/api/geocode/xml?address=%@+%@+%@",road_Str,pin_Str,city_Str];
NSLog(@"str%@",url);
CLLocationCoordinate2D rdOfficeLocation = CLLocationCoordinate2DMake([[latArr objectAtIndex:0] doubleValue], [[lngArr objectAtIndex:0] doubleValue]);
NSString *str = [NSString stringWithFormat:@"comgooglemaps://?q=%@,%@,%@¢er=%f,%f",road_Str,city_Str,pin_Str,rdOfficeLocation.latitude,rdOfficeLocation.longitude];
NSURL *url = [NSURL URLWithString:str];
最佳答案
标记在坐标 (10,20) 处创建,并在单击时在信息窗口中显示字符串“Hello world”。
CLLocationCoordinate2D position = CLLocationCoordinate2DMake(10, 20);
GMSMarker *marker = [GMSMarker markerWithPosition:position];
marker.title = @"Hello World";
marker.map = mapView_;
关于ios - 谷歌地图上的标记标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37857056/