jjzjj

longitude

全部标签

swift - 在 swift 中使用 map 函数制作 MKPointAnnotations

我有一组带有坐标和名称的“放置”对象。例如:letplaces=[place(name:"EiffelTower",latitude:48.8582,longitude:2.2945),place(name:"StatueofLiberty",latitude:40.6892,longitude:-74.0444),place(name:"TowerofLondon",latitude:51.5081,longitude:-0.0761)]从这个数组中,我想使用map创建一个新的MKPointAnnotations数组。我知道它是这样开始的:letplaceAnnotations=pl

ios - 有人可以解释为什么我不能从此方法返回值吗?

我正在尝试使用快速地理编码来获取城市,但不知何故,城市只显示嵌套在方法中,返回时变量为空,这是我正在使用的代码。class{varlocationManager=CLLocationManager()varlongitude=CLLocationDegrees()varlatitude=CLLocationDegrees()varcity=""overridefuncviewDidLoad(){super.viewDidLoad()setupLocation()varx=getLocation()print("\n\nxyourcityis:\(x)\n\n");//'x'isalwa

ios - 在按钮函数中添加两个坐标以启动 mapKit 并开始两点之间的导航(Swift)

我正在使用这个类importUIKitimportCoreLocationimportGoogleMapsimportGooglePlacesimportSwiftyJSONimportAlamofireimportMapKitclassFinalClass:UIViewController{@IBOutletweakvarcontainerView:UIView!@IBOutletweakvarbottomInfoView:UIView!@IBOutletweakvardescriptionLabel:UILabel!@IBOutletweakvardistanceLabel:UIL

ios - 在 Swift 中采用 FIRGeoPoint 到 Codable 协议(protocol)

我有一个FirebaseFirestore文档,其中包含字符串、数字和GeoPoint值。这是print()函数打印的示例控制台输出。["name":"Test","location":,"aNumber":123123]现在我想为这个文档创建一个结构,符合Codable协议(protocol)。structTestStruct:Codable{letname:StringletaNumber:Doubleletlocation:GeoPointstructCodingKeys:CodingKey{casename,location,aNumber}init(fromdecoder:D

微信小程序实现地图定位

前言地图定位这个功能相信大家在学习插件的时候都有过接触,那么在这篇文章中我来为大家介绍微信小程序中的地图定位功能,很简单哦在此之前我们可以先去微信官方文档>小程序>组件>地图进行了解点此进入小程序中map介绍map组件提供了地图展示、交互、叠加点线面及文字等功能,同时支持个性化地图样式,可结合地图服务API实现更丰富功能。1.写一个map标签,并在其中写入经纬度属性,mark标记与点击事件  {latitude}}"longitude="{{longitude}}"markers='{{marker}}'bindtap="click">2.在js文件中的data声明首次加载的经纬度data:{

iphone - Swift 中的同步代码执行

我正在传递一组要进行反向地理编码的纬度和经度坐标。反向地理编码有效,我取回了我的地址数据,但随后我需要根据该数据创建一个URL,我会进一步向下操作。我发现NSURLSession在我取回数据之前正在执行。您可以看到我在println中放置的位置以显示“first”和“second”,但是当我执行此代码时,在输出控制台中显示“second”,然后显示“first”以及地址数据,这告诉我我'm未按顺序运行。我如何强制执行顺序,要求我的变量addchunk在NSURLSession运行之前存在?谢谢!@IBActionfuncgrabData(sender:UIButton){varlati

ios - 如何在定时器选择器上传递参数

这个问题在这里已经有了答案:PassingparameterstothemethodcalledbyaNSTimer(6个答案)关闭5年前。funclocationManager(_manager:CLLocationManager,didUpdateLocationslocations:[CLLocation]){guardletmostRecentLocation=locations.lastelse{return}print(mostRecentLocation.coordinate.latitude)print(mostRecentLocation.coordinate.lon

ios - 将 GMSMapView 限制在特定范围内

我有两个坐标,我需要将我的Googlemapmap限制在以这两个坐标为界的框架内。例如,我有letbounds=GMSCoordinateBounds(coordinate:CLLocationCoordinate2D(latitude:59.615440364671244,longitude:-17.978949286043644),coordinate:CLLocationCoordinate2D(latitude:33.963318167747758,longitude:21.442294009029865))然后,我写,map.cameraTargetBounds=bounds

ios - 我如何在 iOS (swift) 中实现这一点?

我是一名初级程序员。我正在开发一个谷歌地图应用程序,点击一个按钮,我希望所有点击的坐标(我已经有了这个)停止记录,而是开始填充新数组。这是为了保存map的坐标。最好的方法是什么?funcmapView(_mapView:GMSMapView,didTapAtcoordinate:CLLocationCoordinate2D){varlat:CLLocationDegrees=coordinate.latitudevarlng:CLLocationDegrees=coordinate.longitudevarformattedCoordinate=CLLocationCoordinate

ios - NMACoreRouter calculateRouteWithStops 无回调(快速)

我正在尝试在Swift中使用HereAPI创建路由,但我遇到了一些问题,因为从未调用完成block,所以我无法确切知道问题出在哪里。这是我的代码:letcoreRoute=NMACoreRouter()letstartPoint=NMAGeoCoordinates(latitude:latitude1,longitude:longitude1)letwaypoint1=NMAWaypoint(geoCoordinates:startPoint)letmiddlePoint=NMAGeoCoordinates(latitude:latitude2,longitude:longitude2