Tag: 地图方向

Google方向图无法在iPad上加载风景方向

我在加载地图在iPad的景观(在肖像一切工作正常)有问题。 编辑:我发现一个问题,相关的事实,因为缺乏空间,当我减less高度地图元素是“推”下方向元素aparently后。 我试图得到元素的stream体,但它仍然推下去。 景观(问题): 当我将iPad旋转到肖像(OK)时: 代码: 脚本: var _directionsService = new google.maps.DirectionsService(); var _directionsDisplay = new google.maps.DirectionsRenderer(); var _map = new google.maps.Map(document.getElementById('dtl-directions-map-canvas')); _directionsDisplay.setMap(_map); _directionsDisplay.setPanel(document.getElementById('dtl-directions-panel')); var start = new google.maps.LatLng(_locationLatitude, _locationLongitude); var end = new google.maps.LatLng(_partnerLatitude, _partnerLongitude); var request = { origin: start, destination: end, travelMode: google.maps.TravelMode.DRIVING, provideRouteAlternatives: true }; _directionsService.route(request, function (response, status) { if […]

iOS,如何使用Google Places Api显示两点之间的路线?

我一直在寻找如何在iOS中使用Google Places API绘制两点之间的路线 ,但是我还没有find有趣的地方。 您可以在两点之间绘制路线的唯一方法是调用Web服务并将JSONparsing到您的应用程序中,以在两点之间路由路线。 这里有一个参考。 问题是: 是否有任何示例代码可以帮助我如何绘制两点之间的路线,起点(基于用户当前位置)和目的地。

检查用户是否遵循路线(iphone)

我正在做一个基于导航的应用程序。 在这个应用程序中,我正在绘制从用户select的点的路线。 如果用户没有遵循路线,我有重新计算路线的要求。 计算我使用Google direction API的路线。 并绘制我使用此代码的路线 – (void) drawRoute:(NSArray *) path { NSInteger numberOfSteps = path.count; [self.objMapView removeOverlays: self.objMapView.overlays]; CLLocationCoordinate2D coordinates[numberOfSteps]; for (NSInteger index = 0; index < numberOfSteps; index++) { CLLocation *location = [path objectAtIndex:index]; CLLocationCoordinate2D coordinate = location.coordinate; coordinates[index] = coordinate; } for( id <MKOverlay> ovr in [self.objMapView overlays]) { MKPolylineView *polylineView […]

使用地图应用程序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]]; 它会根据适当的驾驶路线打开地图应用程序。 事情是,我想打开地图默认步行方向。 也许我可以在我的请求中传递另一个参数来做到这一点。 任何人都知道如何? 谢谢 !