Tag: google maps markers

更新IOS地图中Google地图的标记位置

我需要更新绘制的路线上的标记位置,直到它到达目的地。现在这里是访问服务器的代码: NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/directions/json?origin=%f,%f&destination=-32.90,151.80&waypoints=-33.30,151.50&alternatives=true",marker.position.latitude,marker.position.longitude]]; 在这之后,我只是更新标记超时的位置,我计算了新的位置。问题出现在给定的路线上,我如何获得标记的新位置。我从儿子数据中得到它,上面的URL.So这里是获取我的新位置的纬度和经度的代码。 NSString *latitudeInString = responseObject[@"routes"][0][@"legs"][0][@"steps"][i][@"end_location"][@"lat"]; CLLocationDegrees latitudeInDegrees = [latitudeInString doubleValue]; NSString *longitudeInString = responseObject[@"routes"][0][@"legs"][0][@"steps"][i][@"end_location"][@"lng"]; CLLocationDegrees longitudeInDegrees = [longitudeInString doubleValue]; 所有这些代码都在NSTimer类的select器方法中。这里是完整的代码: -(void)callInOne:(NSTimer*)timer{ NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/directions/json?origin=%f,%f&destination=-32.90,151.80&waypoints=-33.30,151.50&alternatives=true",marker.position.latitude,marker.position.longitude]]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:urlRequest]; operation.responseSerializer = [AFJSONResponseSerializer serializer]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation,id responseObject){ NSString *polyLinePath = […]

如何使用谷歌地图API跟踪实时位置?

我打算实施车辆跟踪系统。 任何人都可以解释我如何跟踪使用谷歌地图API的Android设备的位置。此外,如果它不是Android设备,我怎么收集设备(Android / iPhone / Windows)的地形位置再次只通过谷歌地图API。 有人可以帮我这个吗?

按照用户所在的方向旋转GMSMarker

我有要求就像我目前的位置一个视图将显示。 它会旋转,如果设备是旋转或位置会改变。我研究了很多,但得到了所有的代码有一个固定的位置或angular度在某些位置,但我没有确定位置。 任何人都可以驾驶我正确的方向。 我也使用GMSMarker的旋转属性,但它不工作。 – (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { if (newHeading.headingAccuracy < 0){ NSLog(@"heading accuracy < 0"); return; } // Convert Degree to Radian and move the needle float oldRad = (- manager.heading.trueHeading) * M_PI / 180.0f; float newRad = (- newHeading.trueHeading) * M_PI / 180.0f; // Compass animation CABasicAnimation *theAnimation; theAnimation = [CABasicAnimation […]

我怎样才能添加一个button谷歌地图标记信息窗口上的iOS?

我已经添加Google地图sdk for ios到我的iPhone应用程序,我有一些自定义标记,如果点击信息窗口popup与标题,我怎么能添加一个button到这个信息窗口,所以如果按下将转到新的页面? 现在我已经尝试使用这个post来解决这个问题在Google地图SDK中的InfoWindow / Marker上添加Click事件本地iOS /目标C它不给我错误,但它不会工作。 这是我想要我的结果是: http : //www.flickr.com/photos/74719051@N05/6728157477/

谷歌地图绘制多个标记问题(信息窗口和标记重复)

首先我创build一个用户位置的地图 -(void)initGogleMapView{ GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:currentLocation.coordinate.latitude longitude:currentLocation.coordinate.longitude zoom:1]; mapView = [GMSMapView mapWithFrame:CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height-64) camera:camera]; [self.view addSubview:mapView]; GMSMarker *marker = [[GMSMarker alloc] init]; marker.position = camera.target; marker.appearAnimation = kGMSMarkerAnimationPop; marker.map = mapView; marker.title=@"Current Location"; } 然后我有一个经度和纬度的数组和循环的阴谋 for(int i=0;i<[latLongArr count];i++) { GMSMarker *tempmarker = [[GMSMarker alloc] init]; tempmarker.position = CLLocationCoordinate2DMake([[[latLongArr objectAtIndex:i] valueForKey:@"Latitude"] floatValue],[[[latLongArr objectAtIndex:i] […]

在Google Maps SDK中的InfoWindow / Marker上添加Click事件,以实现本机iOS / Objective C

简单的问题 我正在开发一个适用于iOS的应用程序,其中embedded了用于本机iOS的新Google Map。 一切工作正常,除了一个问题,我不能find一个本地IOS / Objective-C的propper解决scheme既不在这里,也不在谷歌(如果有一个请给我看,对不起,烦你) 我想要什么:我希望用户点击打开信息窗口的标记。 之后如果他点击或点击信息窗口,它应该打开一个新的UIView进一步的信息。 我怎样才能做到这一点? 感谢您的build议