我的目的是从ios应用程序打开地图应用程序和方向,我能够打开地图应用程序,但它没有显示方向,我已编写如下代码
NSString *mystr=[[NSString alloc] initWithFormat:@"http://maps.apple.com/maps?saddr=Current+Location&daddr=Newyork"];
NSURL *myurl=[[NSURL alloc] initWithString:mystr];
[[UIApplication sharedApplication] openURL:myurl];
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我解释如何将参数传递给这个网址和其他任何一个?
我在调用苹果地图方向时没有获得语音指示.
这是我的代码.
CLLocationCoordinate2D userCoord = [self.userLocation coordinate];
CLLocationCoordinate2D opponentCoord = [self.opponentLocation coordinate];
MKPlacemark *fromPlace = [[MKPlacemark alloc] initWithCoordinate:userCoord addressDictionary:nil];
MKPlacemark *destinationPlace = [[MKPlacemark alloc] initWithCoordinate:opponentCoord addressDictionary:nil];
MKMapItem *fromItem = [[MKMapItem alloc] initWithPlacemark:fromPlace];
fromItem.name = @"Current Location";
MKMapItem *destinationItem = [[MKMapItem alloc] initWithPlacemark:destinationPlace];
destinationItem.name = self.game[@"opponent"];
NSArray *items = @[fromItem, destinationItem];
NSDictionary *options = @{MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving, MKLaunchOptionsMapTypeKey:@(MKMapTypeStandard), MKLaunchOptionsShowsTrafficKey:@YES};
[MKMapItem openMapsWithItems:items launchOptions:options];
Run Code Online (Sandbox Code Playgroud)
我的iPhone 5S上的导航语音音量设置为正常,我已重新启动手机.语音转换指示在所有其他时间都可以正常工作,而不是来自我的应用程序.
iOS 10 Apple Map有"显示驻留位置",我喜欢这个功能.
我想为我停放的地点的历史制作应用程序,但我找不到API.
如何获取Apple Maps控制的停放位置信息?
或者如何通过Apple Maps而不是Apple Maps实现此功能?
我正在尝试使用Apple Maps在URL中设置地图类型,但它似乎并没有起作用.我能做些什么不同的事情?我这样做是通过&t=satellite在URL中指定类型,如下所示:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=%@,%@&t=satellite", LatitudeCurrentLocation, LongitudeCurrentLocation]]];
Run Code Online (Sandbox Code Playgroud)
纬度和经度是包含纬度和经度坐标的NSStrings.
如何在URL中设置may类型?
我一直在构建一个应用程序,它固定地图并且到目前为止一直在使用Apple Maps.但是,我注意到,当放大时,Apple在其地图中包含的默认POI注释非常分散注意力,并且当我将自己的注释添加到地图时也会使地图感到混乱.
我正在寻找一种方法来在API中关闭这些POI但尚未找到正确的属性或方法来执行此操作.
需要注意的是,它确实可能因为新的OpenTable应用程序正在使用Apple Maps,但已找到一种方法来删除这些POI注释.我会发布每个图像以显示差异,但显然我需要10个声望点才能做到这一点!
如果有人甚至可以指向一个链接,告诉我如何删除这些,我很高兴阅读文档.
我在iOS应用程序中实现了搜索栏.我想获得与Apple Maps应用程序相同(部分结果)的搜索提示.我试图找出苹果如何实现它,但我在谷歌或在stackoverflow上没有成功.
在我的UITableView*searchHintTableView中显示的内容无关紧要.我只是没有得到正确的搜索提示数量.我在相同的设备和相同的3G wifi网络(3G SIM路由器)上使用我的应用程序和Apple Maps应用程序.
我尝试了什么:
在方法中:
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText;
Run Code Online (Sandbox Code Playgroud)
我有以下代码:
...
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
NSString *location = [NSString stringWithFormat:@"%@", searchText];
// CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:coord
// radius:100000000 identifier:@"Hint Region"];
// [geocoder cancelGeocode];
[geocoder geocodeAddressString:location
completionHandler:^(NSArray *placemarks, NSError *error) {
if (error != nil) {
DDLogCVerbose(@"Error %@", [error description]);
[searchHintArray removeAllObjects];
[searchHintTableView reloadData];
return;
}
DDLogCVerbose(@"CLGeocoder >> %@", [placemarks description]);
//to get rid of unwanted results …Run Code Online (Sandbox Code Playgroud) 我一直在努力解决这个问题.在人们从弹出窗口按"呼叫"后,我正试图打电话.有趣的是,当他们点击电话号码时,它会直接拨打电话.但当他们点击"呼叫"时,控制台返回:
ERROR Internal navigation rejected - <allow-navigation> not set for url='tel:06-83237516
码:
控制器:
$scope.callPerson = function() {
var link = "tel:" + $scope.person.phonenumber;
var confirmTel = $ionicPopup.confirm({
title: $scope.person.phonenumber,
cancelText: 'Cancel',
okText: 'Call'
});
confirmTel.then(function(res) {
if (res) {
window.open(link);
} else {
console.log('cancel call');
}
});
}
Run Code Online (Sandbox Code Playgroud)
config.xml文件:
<access origin="*"/>
<allow-intent href="tel:*"/>
<allow-intent href="mailto:*"/>
<access origin="tel:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
Run Code Online (Sandbox Code Playgroud)
HTML:
<div ng-click="callPerson()"> {{person.phonenumber}}</div>
Run Code Online (Sandbox Code Playgroud)
使用Mail,它根本不起作用,并返回相同的错误.打开地图也一样.它在PhoneGap测试应用程序中有效,但在部署时无效.
地图代码:
$scope.openmaps = function() {
var address = $scope.person.adres + ", " + $scope.person.plaats; …Run Code Online (Sandbox Code Playgroud) 我实现了一张地图,效果很好.但是当我尝试放大地图时,我发现这个问题面临:
这是我的代码:
- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
{
MKPolylineRenderer *renderer = [[MKPolylineRenderer alloc] initWithPolyline:(id)overlay];
renderer.strokeColor = [UIColor redColor]; // pathColor;
renderer.lineWidth = 7.0;
return renderer;
}
Run Code Online (Sandbox Code Playgroud) 苹果地图无法提供路线时,可以打开路线应用:
我想从我的应用程序中打开其中一些应用程序。我知道我必须将要打开的每个应用程序列入白名单。这不是问题。
如何找出安装在我的 iPhone 上的那些应用程序的 url 方案?
一种想法是通过 iTunes 和应用程序的 info.plist 进行备份。在这个 plist 中,应该使用 cfbundleurlschemes 键定义 url 方案。
我想我在备份中找到了这样的应用程序,但我不知道如何提取文件以获取 info.plist 文件。添加 .zip 并解压缩不起作用。
也欢迎其他获取 URL 方案的方法,尤其是获取应用程序 URL 方案的示例参数的方法。所以看看 Apple Maps 如何打开一个特定的路由应用程序会很好。
是的,我知道如何打开 Google 地图。我想知道如何打开那些找不到文档的文件。
那么如何在我的 iPhone 上找出路由应用程序的 URL 方案呢?
有一个答案建议提取 .ipa 文件,但不再有 iOSA 11 的 .ipa 文件。
apple-maps ×10
ios ×8
objective-c ×5
iphone ×2
maps ×2
annotations ×1
cordova ×1
direction ×1
geocoding ×1
google-maps ×1
ios10 ×1
mapkit ×1
url-scheme ×1