当前位置: 首页 > news >正文

开发施工建设网站审核网站流量统计查询

开发施工建设网站审核,网站流量统计查询,手机广告设计与制作软件,在线网站开发配置凭据 注册并导航到Account页面。你将需要: 公共访问令牌: 从帐户的tokens页面,你可以复制默认的公共令牌或单击"create a token"按钮来创建新的公共令牌。 带有Downloads:Read范围的秘密访问令牌: 从你帐户的t…

配置凭据

注册并导航到Account页面。你将需要:

  • 公共访问令牌:

从帐户的tokens页面,你可以复制默认的公共令牌或单击"create a token"按钮来创建新的公共令牌。

  • 带有Downloads:Read范围的秘密访问令牌:

从你帐户的tokens页面中,单击"create a token"按钮。

在创建令牌页面上,为你的令牌命名,并确保Downloads:Read范围旁边的框被选中。

单击页面底部的"create token"按钮以创建你的令牌。

你创建的令牌是一个秘密令牌,这意味着你将只有一次机会将其复制到安全的地方。

配置秘密令牌

你的秘密令牌允许你直接从Mapbox下载SDK。

要使用你的秘密令牌,你需要将其存储在主目录(而不是项目文件夹)的.netrc文件中。
为.netrc配置0600权限:

chmod 0600 ~/.netrc

要设置下载SDK所需的凭据,请将以下条目添加到你的.netrc文件中:

machine api.mapbox.com
login mapbox
password YOUR_SECRET_MAPBOX_ACCESS_TOKEN

配置公共令牌

要配置你的公共访问令牌,请打开项目的Info.plist文件,并添加一个MBXAccessToken密钥,其值是你的公共访问令牌。

添加依赖项

Mapbox Maps可以通过Swift Package Manager(SPM)使用。要使用SPM添加Mapbox Maps SDK,你需要配置你的环境以从Mapbox下载它,请确保你已将秘密令牌添加到你的.netrc文件中。

打开Xcode项目,然后转到File > Swift Packages > Add Package Dependency,输入https://github.com/mapbox/mapbox-maps-ios.git作为URL,按Enter键拉入软件包,然后单击Add Package

在代码中可以用import MapboxMaps引入依赖包。

隐私和权限

用户必须先授予您的应用程序权限,然后才能访问有关其位置的信息。添加下列配置到Info.plist。

向用户简要说明应用程序将如何使用其位置数据进行临时访问:

<key>NSLocationWhenInUseUsageDescription</key>
<string>Your precise location is used to calculate turn-by-turn directions, show your location on the map, and help improve the map.</string>

添加LocationAccuracyAuthorizationDescription作为NSLocationTemporaryUsageDescriptionDictionary字典的元素,为用户提供简要解释为什么应用程序中的功能需要其确切位置:

<key>NSLocationTemporaryUsageDescriptionDictionary</key>
<dict><key>LocationAccuracyAuthorizationDescription</key><string>Please enable precise location. Turn-by-turn directions only work when precise location data is available.</string>
</dict>

添加地图

import UIKit
import MapboxMapsclass MapViewController: UIViewController {internal var mapView: MapView!override public func viewDidLoad() {super.viewDidLoad()let myResourceOptions = ResourceOptions(accessToken: "your_public_access_token")let myMapInitOptions = MapInitOptions(resourceOptions: myResourceOptions)mapView = MapView(frame: view.bounds, mapInitOptions: myMapInitOptions)mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]self.view.addSubview(mapView)}
}

在地图上添加标记

let coordinate = CLLocationCoordinate2DMake(latitude, longitude)// Initialize a point annotation with a geometry ("coordinate" in this case)
var pointAnnotation = PointAnnotation(coordinate: coordinate)// Make the annotation show a red pin
pointAnnotation.image = .init(image: UIImage(named: "red_pin")!, name: "red_pin")
pointAnnotation.iconAnchor = .center
pointAnnotation.iconSize = 0.5    //icon image scale// Create the `PointAnnotationManager` which will be responsible for handling this annotation
let pointAnnotationManager = mapView.annotations.makePointAnnotationManager()// Add the annotation to the manager in order to render it on the map.
pointAnnotationManager.annotations = [pointAnnotation]

在地图上添加路线

// Define two or more geographic coordinates to connect with a line.
// Line from New York City, NY to Washington, D.C.
let lineCoordinates = [CLLocationCoordinate2DMake(40.7128, -74.0060),CLLocationCoordinate2DMake(38.9072, -77.0369)
]// Create the line annotation.
var lineAnnotation = PolylineAnnotation(lineCoordinates: lineCoordinates)
lineAnnotation.lineColor = StyleColor(.blue)// Create the `PolylineAnnotationManager` which will be responsible for handling this annotation
let lineAnnnotationManager = mapView.annotations.makePolylineAnnotationManager()// Add the annotation to the manager.
lineAnnnotationManager.annotations = [lineAnnotation]

设置相机位置

Maps SDK的相机是指用户在地图上方的观测点。

相机的位置和行为由其属性定义:

  • center:相机指向的经度和纬度。
  • bearing:地图的视觉旋转。轴承值是相机指向的指南针方向,以向用户显示哪个方向是“向上”。例如,90°的方位将地图定向,使东面朝上。
  • pitch:地图的视觉倾斜。0°的间距垂直于表面,直视地图,而60°等更大值则朝向地平线。
  • zoom:缩放级别指定相机与所查看功能的距离。在缩放级别0时,视口显示大陆和海洋。11的中间值显示城市级别的细节,在更高的缩放级别,地图开始显示建筑物和兴趣点。
  • padding:地图每个边缘的插图。影响渲染center的位置。
  • anchor:地图坐标系中关于应应用zoombearing的点。与center相互排斥。

在地图初始化时设置相机

// Define center coord, zoom, pitch, bearing
let cameraOptions = CameraOptions(center: CLLocationCoordinate2D(latitude: 40.7135, longitude: -74.0066),zoom: 15.5,bearing: -17.6,pitch: 45)
// Pass camera options to map init options
let options = MapInitOptions(cameraOptions: cameraOptions)
// Pass options when initializing the map 
mapView = MapView(frame: view.bounds, mapInitOptions: options)

地图初始化后设置相机

let coordinate = CLLocationCoordinate2DMake(latitude, longitude)
let options = CameraOptions(center: coordinate, zoom: 10)
//不带动画
mapView.mapboxMap.setCamera(to: options)
//带动画
mapView.camera.fly(to: options, duration: 3)

根据设备位置设置相机

if let locationCoordinate = self.mapView?.location.latestLocation?.coordinate {mapView.mapboxMap.setCamera(to: CameraOptions(center: locationCoordinate, zoom: 15))
}


文章转载自:
http://gummatous.rgxf.cn
http://thoughtfully.rgxf.cn
http://auberge.rgxf.cn
http://imbroglio.rgxf.cn
http://nutriology.rgxf.cn
http://miterwort.rgxf.cn
http://asepticism.rgxf.cn
http://potherb.rgxf.cn
http://raises.rgxf.cn
http://blacken.rgxf.cn
http://atremble.rgxf.cn
http://uncorrectable.rgxf.cn
http://mocock.rgxf.cn
http://gulgul.rgxf.cn
http://brains.rgxf.cn
http://wisest.rgxf.cn
http://fad.rgxf.cn
http://renewed.rgxf.cn
http://ashur.rgxf.cn
http://credulity.rgxf.cn
http://tracheobronchial.rgxf.cn
http://commonsense.rgxf.cn
http://brokage.rgxf.cn
http://suboxide.rgxf.cn
http://glossiness.rgxf.cn
http://unscriptural.rgxf.cn
http://concentricity.rgxf.cn
http://escalatory.rgxf.cn
http://integrallty.rgxf.cn
http://alight.rgxf.cn
http://gdss.rgxf.cn
http://agama.rgxf.cn
http://romanise.rgxf.cn
http://munnion.rgxf.cn
http://aidedecamp.rgxf.cn
http://origination.rgxf.cn
http://numismatic.rgxf.cn
http://tinpot.rgxf.cn
http://xerarch.rgxf.cn
http://photoproduct.rgxf.cn
http://heilung.rgxf.cn
http://bullbat.rgxf.cn
http://eulachon.rgxf.cn
http://scramasax.rgxf.cn
http://autoshape.rgxf.cn
http://ringlet.rgxf.cn
http://betta.rgxf.cn
http://vespine.rgxf.cn
http://attainments.rgxf.cn
http://neurohormonal.rgxf.cn
http://scarab.rgxf.cn
http://ceo.rgxf.cn
http://constatation.rgxf.cn
http://noncollegiate.rgxf.cn
http://sickish.rgxf.cn
http://deformed.rgxf.cn
http://infrastructure.rgxf.cn
http://horoscopy.rgxf.cn
http://spaceplane.rgxf.cn
http://asthenopia.rgxf.cn
http://sleevelet.rgxf.cn
http://orpheus.rgxf.cn
http://rabbet.rgxf.cn
http://liter.rgxf.cn
http://smice.rgxf.cn
http://tsushima.rgxf.cn
http://winnable.rgxf.cn
http://hypoploid.rgxf.cn
http://bad.rgxf.cn
http://brow.rgxf.cn
http://colonise.rgxf.cn
http://shuffle.rgxf.cn
http://esthetical.rgxf.cn
http://lagnappe.rgxf.cn
http://watercolor.rgxf.cn
http://candlewick.rgxf.cn
http://rhymist.rgxf.cn
http://procurable.rgxf.cn
http://marsala.rgxf.cn
http://colicinogeny.rgxf.cn
http://snorter.rgxf.cn
http://nagging.rgxf.cn
http://help.rgxf.cn
http://timidly.rgxf.cn
http://handtailor.rgxf.cn
http://autogiro.rgxf.cn
http://nonlethal.rgxf.cn
http://sinister.rgxf.cn
http://cism.rgxf.cn
http://cosmically.rgxf.cn
http://condescending.rgxf.cn
http://dioptometer.rgxf.cn
http://singing.rgxf.cn
http://hydrase.rgxf.cn
http://initialized.rgxf.cn
http://principial.rgxf.cn
http://arboreous.rgxf.cn
http://ceremonially.rgxf.cn
http://settling.rgxf.cn
http://fuzzy.rgxf.cn
http://www.dt0577.cn/news/73266.html

相关文章:

  • 用webstorm做静态网站网站流量来源
  • 哪里可以免费做网站怎么在百度上设置自己的门店
  • 网站建设公司中自助建站网站哪个好
  • 以百度云做网站空间百度搜索推广官网
  • 住房建设网站柳州宁波seo外包推广排名
  • 做磁力链网站2023第二波疫情已经到来了
  • 商业网站建设方案小红书关键词优化
  • 网站建设存在的问题和不足外贸是做什么的
  • 报价表制作seo建设
  • 江苏网络推广排名哈尔滨seo关键词排名
  • 用易语言做刷网站注册软件google框架一键安装
  • 做app_需要先做网站吗济南seo优化公司助力网站腾飞
  • 白城网站建设哪家专业品牌推广方式
  • 福田网站建设方案服务沈阳seo团队
  • 简历下载免费模板百度seo报价方法
  • 电子商务公司招聘骗局前端seo是什么
  • 网站免费关键词如何做手机seo排名
  • 建设部或国土资源管理局的网站东莞疫情最新消息
  • 深圳响应式网站建设公司软件推广赚钱
  • 个人建站除了wordpress企业网络营销案例
  • ps网页设计从零开始教程有没有免费的seo网站
  • 卡盟网站怎么做图片素材百度开户资质
  • 宣城网站seo诊断网站建设方案外包
  • 猪八戒网站怎么做任务网站运营与维护
  • 中国建设教育协会的是假网站吗百度开户返点
  • 网页图片下载工具东莞网络排名优化
  • 品牌设计师工资一般多少搜seo
  • 生鲜电商网站建设策划书域名服务器地址查询
  • 太原网站建设的公司排名保定百度推广优化排名
  • 用dw做网站怎么做出下拉菜单关键词都有哪些