{"payload":{"allShortcutsEnabled":false,"fileTree":{"docs/v1.0.14":{"items":[{"name":"CHANGELOG","path":"docs/v1.0.14/CHANGELOG","contentType":"directory"},{"name":"InteractiveLayers.md","path":"docs/v1.0.14/InteractiveLayers.md","contentType":"file"},{"name":"MapplsAPICore.md","path":"docs/v1.0.14/MapplsAPICore.md","contentType":"file"},{"name":"MapplsAPIKit.md","path":"docs/v1.0.14/MapplsAPIKit.md","contentType":"file"},{"name":"MapplsAnnotationExtension.md","path":"docs/v1.0.14/MapplsAnnotationExtension.md","contentType":"file"},{"name":"MapplsDirectionUI.md","path":"docs/v1.0.14/MapplsDirectionUI.md","contentType":"file"},{"name":"MapplsDrivingRangePlugin.md","path":"docs/v1.0.14/MapplsDrivingRangePlugin.md","contentType":"file"},{"name":"MapplsFeedbackKit.md","path":"docs/v1.0.14/MapplsFeedbackKit.md","contentType":"file"},{"name":"MapplsFeedbackUIKit.md","path":"docs/v1.0.14/MapplsFeedbackUIKit.md","contentType":"file"},{"name":"MapplsGeoanalytics.md","path":"docs/v1.0.14/MapplsGeoanalytics.md","contentType":"file"},{"name":"MapplsGeofenceUI.md","path":"docs/v1.0.14/MapplsGeofenceUI.md","contentType":"file"},{"name":"MapplsIntouch.md","path":"docs/v1.0.14/MapplsIntouch.md","contentType":"file"},{"name":"MapplsMap.md","path":"docs/v1.0.14/MapplsMap.md","contentType":"file"},{"name":"MapplsMapStyle.md","path":"docs/v1.0.14/MapplsMapStyle.md","contentType":"file"},{"name":"MapplsNearbyUI.md","path":"docs/v1.0.14/MapplsNearbyUI.md","contentType":"file"},{"name":"MapplsPinStrategy.md","path":"docs/v1.0.14/MapplsPinStrategy.md","contentType":"file"},{"name":"MapplsTrafficVectorTileOverlay.md","path":"docs/v1.0.14/MapplsTrafficVectorTileOverlay.md","contentType":"file"},{"name":"MapplsUIWidgets.md","path":"docs/v1.0.14/MapplsUIWidgets.md","contentType":"file"},{"name":"Predictive-Route-APIs.md","path":"docs/v1.0.14/Predictive-Route-APIs.md","contentType":"file"},{"name":"README.md","path":"docs/v1.0.14/README.md","contentType":"file"},{"name":"RasterCatalouge.md","path":"docs/v1.0.14/RasterCatalouge.md","contentType":"file"},{"name":"Regions.md","path":"docs/v1.0.14/Regions.md","contentType":"file"}],"totalCount":22},"docs":{"items":[{"name":"v1.0.0","path":"docs/v1.0.0","contentType":"directory"},{"name":"v1.0.1","path":"docs/v1.0.1","contentType":"directory"},{"name":"v1.0.10","path":"docs/v1.0.10","contentType":"directory"},{"name":"v1.0.11","path":"docs/v1.0.11","contentType":"directory"},{"name":"v1.0.12","path":"docs/v1.0.12","contentType":"directory"},{"name":"v1.0.13","path":"docs/v1.0.13","contentType":"directory"},{"name":"v1.0.14","path":"docs/v1.0.14","contentType":"directory"},{"name":"v1.0.2","path":"docs/v1.0.2","contentType":"directory"},{"name":"v1.0.3","path":"docs/v1.0.3","contentType":"directory"},{"name":"v1.0.4","path":"docs/v1.0.4","contentType":"directory"},{"name":"v1.0.5","path":"docs/v1.0.5","contentType":"directory"},{"name":"v1.0.6","path":"docs/v1.0.6","contentType":"directory"},{"name":"v1.0.7","path":"docs/v1.0.7","contentType":"directory"},{"name":"v1.0.8","path":"docs/v1.0.8","contentType":"directory"},{"name":"v1.0.9","path":"docs/v1.0.9","contentType":"directory"}],"totalCount":15},"":{"items":[{"name":"MapplsSDKDemo.xcodeproj","path":"MapplsSDKDemo.xcodeproj","contentType":"directory"},{"name":"MapplsSDKDemo","path":"MapplsSDKDemo","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"LICENSE.md","path":"LICENSE.md","contentType":"file"},{"name":"Mappls.podspec","path":"Mappls.podspec","contentType":"file"},{"name":"Podfile","path":"Podfile","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"Version-History.md","path":"Version-History.md","contentType":"file"}],"totalCount":8}},"fileTreeProcessingTime":5.473671,"foldersToFetch":[],"reducedMotionEnabled":null,"repo":{"id":491393896,"defaultBranch":"main","name":"mappls-ios-sdk","ownerLogin":"mappls-api","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2022-05-12T06:38:36.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/98086022?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"main","listCacheKey":"v0:1688030274.0","canEdit":false,"refType":"branch","currentOid":"b20e647218d1b067f956afb0c93101c1af9d57fe"},"path":"docs/v1.0.14/MapplsMap.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/mappls-api/mappls-ios-sdk/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null,"repoAlertsPath":"/mappls-api/mappls-ios-sdk/security/dependabot","repoSecurityAndAnalysisPath":"/mappls-api/mappls-ios-sdk/settings/security_analysis","repoOwnerIsOrg":true,"currentUserCanAdminRepo":false},"displayName":"MapplsMap.md","displayUrl":"https://github.com/mappls-api/mappls-ios-sdk/blob/main/docs/v1.0.14/MapplsMap.md?raw=true","headerInfo":{"blobSize":"35.9 KB","deleteInfo":{"deleteTooltip":"You must be signed in to make or propose changes"},"editInfo":{"editTooltip":"You must be signed in to make or propose changes"},"ghDesktopPath":"https://desktop.github.com","gitLfsPath":null,"onBranch":true,"shortPath":"2f1ce3f","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fmappls-api%2Fmappls-ios-sdk%2Fblob%2Fmain%2Fdocs%2Fv1.0.14%2FMapplsMap.md","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"Mappls Map SDK","anchor":"mappls-map-sdk","htmlText":"Mappls Map SDK"},{"level":2,"text":"Introduction","anchor":"introduction","htmlText":"Introduction"},{"level":1,"text":"Map SDK","anchor":"map-sdk","htmlText":"Map SDK"},{"level":2,"text":"Getting Started","anchor":"getting-started","htmlText":"Getting Started"},{"level":2,"text":"Version History","anchor":"version-history","htmlText":"Version History"},{"level":2,"text":"Setup your Project","anchor":"setup-your-project","htmlText":"Setup your Project"},{"level":4,"text":"Create a new project in Xcode.","anchor":"create-a-new-project-in-xcode","htmlText":"Create a new project in Xcode."},{"level":2,"text":"Authorization","anchor":"authorization","htmlText":"Authorization"},{"level":3,"text":"MapplsAPICore","anchor":"mapplsapicore","htmlText":"MapplsAPICore"},{"level":3,"text":"MapplsMap","anchor":"mapplsmap","htmlText":"MapplsMap"},{"level":2,"text":"Usage","anchor":"usage","htmlText":"Usage"},{"level":2,"text":"Add a Mappls Map View","anchor":"add-a-mappls-map-view","htmlText":"Add a Mappls Map View"},{"level":4,"text":"By Interface Builder","anchor":"by-interface-builder","htmlText":"By Interface Builder"},{"level":4,"text":"By Programmatically","anchor":"by-programmatically","htmlText":"By Programmatically"},{"level":4,"text":"Objective C","anchor":"objective-c","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift","htmlText":"Swift"},{"level":2,"text":"Map Interactions","anchor":"map-interactions","htmlText":"Map Interactions"},{"level":3,"text":"Set Zoom Level","anchor":"set-zoom-level","htmlText":"Set Zoom Level"},{"level":4,"text":"Objective C","anchor":"objective-c-1","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-1","htmlText":"Swift"},{"level":3,"text":"Set Map Center","anchor":"set-map-center","htmlText":"Set Map Center"},{"level":4,"text":"Objective C","anchor":"objective-c-2","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-2","htmlText":"Swift"},{"level":2,"text":"Map Features","anchor":"map-features","htmlText":"Map Features"},{"level":3,"text":"Current Location","anchor":"current-location","htmlText":"Current Location"},{"level":4,"text":"Objective C","anchor":"objective-c-3","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-3","htmlText":"Swift"},{"level":3,"text":"Tracking Mode","anchor":"tracking-mode","htmlText":"Tracking Mode"},{"level":4,"text":"Objective C","anchor":"objective-c-4","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-4","htmlText":"Swift"},{"level":2,"text":"Map Events","anchor":"map-events","htmlText":"Map Events"},{"level":3,"text":"Map Position Changes Events","anchor":"map-position-changes-events","htmlText":"Map Position Changes Events"},{"level":3,"text":"Loading the Map Events","anchor":"loading-the-map-events","htmlText":"Loading the Map Events"},{"level":4,"text":"-authorizationCompleted:withError:","anchor":"-authorizationcompletedwitherror","htmlText":"-authorizationCompleted:withError:"},{"level":4,"text":"-mapViewWillStartLoadingMap:","anchor":"-mapviewwillstartloadingmap","htmlText":"-mapViewWillStartLoadingMap:"},{"level":4,"text":"-mapViewDidFinishLoadingMap:","anchor":"-mapviewdidfinishloadingmap","htmlText":"-mapViewDidFinishLoadingMap:"},{"level":4,"text":"-mapViewDidFailLoadingMap:withError:","anchor":"-mapviewdidfailloadingmapwitherror","htmlText":"-mapViewDidFailLoadingMap:withError:"},{"level":4,"text":"-mapViewWillStartRenderingFrame:","anchor":"-mapviewwillstartrenderingframe","htmlText":"-mapViewWillStartRenderingFrame:"},{"level":4,"text":"-mapViewDidFinishRenderingFrame:fullyRendered:","anchor":"-mapviewdidfinishrenderingframefullyrendered","htmlText":"-mapViewDidFinishRenderingFrame:fullyRendered:"},{"level":4,"text":"-mapViewDidBecomeIdle:","anchor":"-mapviewdidbecomeidle","htmlText":"-mapViewDidBecomeIdle:"},{"level":4,"text":"-mapView:didFinishLoadingStyle:","anchor":"-mapviewdidfinishloadingstyle","htmlText":"-mapView:didFinishLoadingStyle:"},{"level":4,"text":"-mapView:didTapPlaceWithMapplsPin:","anchor":"-mapviewdidtapplacewithmapplspin","htmlText":"-mapView:didTapPlaceWithMapplsPin:"},{"level":3,"text":"SDK Error Codes","anchor":"sdk-error-codes","htmlText":"SDK Error Codes"},{"level":3,"text":"Tracking User Location Events","anchor":"tracking-user-location-events","htmlText":"Tracking User Location Events"},{"level":3,"text":"Appearance of Annotations Events","anchor":"appearance-of-annotations-events","htmlText":"Appearance of Annotations Events"},{"level":3,"text":"Annotation Views Events","anchor":"annotation-views-events","htmlText":"Annotation Views Events"},{"level":3,"text":"Selecting Annotations Events","anchor":"selecting-annotations-events","htmlText":"Selecting Annotations Events"},{"level":3,"text":"Callout Views Events","anchor":"callout-views-events","htmlText":"Callout Views Events"},{"level":2,"text":"Map Tap Events","anchor":"map-tap-events","htmlText":"Map Tap Events"},{"level":3,"text":"Single Tap Gesture","anchor":"single-tap-gesture","htmlText":"Single Tap Gesture"},{"level":4,"text":"Objective C","anchor":"objective-c-5","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-5","htmlText":"Swift"},{"level":3,"text":"Long Tap Gesture","anchor":"long-tap-gesture","htmlText":"Long Tap Gesture"},{"level":4,"text":"Objective C","anchor":"objective-c-6","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-6","htmlText":"Swift"},{"level":2,"text":"Map Overlays","anchor":"map-overlays","htmlText":"Map Overlays"},{"level":3,"text":"Add marker","anchor":"add-marker","htmlText":"Add marker"},{"level":4,"text":"Objective C","anchor":"objective-c-7","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-7","htmlText":"Swift"},{"level":3,"text":"Remove marker","anchor":"remove-marker","htmlText":"Remove marker"},{"level":4,"text":"Objective C","anchor":"objective-c-8","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-8","htmlText":"Swift"},{"level":3,"text":"Custom Marker (Change Default Marker Icon)","anchor":"custom-marker-change-default-marker-icon","htmlText":"Custom Marker (Change Default Marker Icon)"},{"level":3,"text":"Show Info Window (Callout)","anchor":"show-info-window-callout","htmlText":"Show Info Window (Callout)"},{"level":3,"text":"Custom Info Window(#Custom-Info-Window)","anchor":"custom-info-windowcustom-info-window","htmlText":"Custom Info Window(#Custom-Info-Window)"},{"level":2,"text":"Polylines","anchor":"polylines","htmlText":"Polylines"},{"level":3,"text":"Add a Polyline","anchor":"add-a-polyline","htmlText":"Add a Polyline"},{"level":4,"text":"Objective C","anchor":"objective-c-9","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-9","htmlText":"Swift"},{"level":3,"text":"Remove a Polyline","anchor":"remove-a-polyline","htmlText":"Remove a Polyline"},{"level":4,"text":"Objective C","anchor":"objective-c-10","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-10","htmlText":"Swift"},{"level":3,"text":"Polyline Width","anchor":"polyline-width","htmlText":"Polyline Width"},{"level":4,"text":"Objective C","anchor":"objective-c-11","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-11","htmlText":"Swift"},{"level":2,"text":"Polygons","anchor":"polygons","htmlText":"Polygons"},{"level":3,"text":"Add a Polygon","anchor":"add-a-polygon","htmlText":"Add a Polygon"},{"level":4,"text":"Objective C","anchor":"objective-c-12","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-12","htmlText":"Swift"},{"level":3,"text":"Remove a Polygon","anchor":"remove-a-polygon","htmlText":"Remove a Polygon"},{"level":4,"text":"Objective C","anchor":"objective-c-13","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-13","htmlText":"Swift"},{"level":2,"text":"Map Camera","anchor":"map-camera","htmlText":"Map Camera"},{"level":3,"text":"Fit Map Camera","anchor":"fit-map-camera","htmlText":"Fit Map Camera"},{"level":4,"text":"Swift","anchor":"swift-14","htmlText":"Swift"},{"level":3,"text":"Create Camera For Shape","anchor":"create-camera-for-shape","htmlText":"Create Camera For Shape"},{"level":4,"text":"Objective C","anchor":"objective-c-14","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-15","htmlText":"Swift"},{"level":2,"text":"Miscellaneous","anchor":"miscellaneous","htmlText":"Miscellaneous"},{"level":3,"text":"Shape Stroke Color","anchor":"shape-stroke-color","htmlText":"Shape Stroke Color"},{"level":4,"text":"Objective C","anchor":"objective-c-15","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-16","htmlText":"Swift"},{"level":3,"text":"Shape Fill Color","anchor":"shape-fill-color","htmlText":"Shape Fill Color"},{"level":4,"text":"Objective C","anchor":"objective-c-16","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-17","htmlText":"Swift"},{"level":3,"text":"Shape Opacity","anchor":"shape-opacity","htmlText":"Shape Opacity"},{"level":4,"text":"Objective C","anchor":"objective-c-17","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-18","htmlText":"Swift"},{"level":3,"text":"Safety Status Strip","anchor":"safety-status-strip","htmlText":"Safety Status Strip"},{"level":3,"text":"Cluster Based Authentication","anchor":"cluster-based-authentication","htmlText":"Cluster Based Authentication"},{"level":4,"text":"Set Cluster Device","anchor":"set-cluster-device","htmlText":"Set Cluster Device"},{"level":4,"text":"Objective C","anchor":"objective-c-18","htmlText":"Objective C"},{"level":4,"text":"Swift","anchor":"swift-19","htmlText":"Swift"},{"level":2,"text":"SwiftUI","anchor":"swiftui","htmlText":"SwiftUI"},{"level":3,"text":"Create Map View","anchor":"create-map-view","htmlText":"Create Map View"},{"level":3,"text":"Respond To Map Events","anchor":"respond-to-map-events","htmlText":"Respond To Map Events"},{"level":2,"text":"Our many happy customers:","anchor":"our-many-happy-customers","htmlText":"Our many happy customers:"}],"lineInfo":{"truncatedLoc":"1008","truncatedSloc":"726"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplateHelpUrl":"https://githubdocs.cn/articles/about-issue-and-pull-request-templates","issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"loggedIn":false,"newDiscussionPath":"/mappls-api/mappls-ios-sdk/discussions/new","newIssuePath":"/mappls-api/mappls-ios-sdk/issues/new","planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/mappls-api/mappls-ios-sdk/blob/main/docs/v1.0.14/MapplsMap.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","dismissStackNoticePath":"/settings/dismiss-notice/publish_stack_from_file","releasePath":"/mappls-api/mappls-ios-sdk/releases/new?marketplace=true","showPublishActionBanner":false,"showPublishStackBanner":false},"renderImageOrRaw":false,"richText":"
此仓库包含了一个 iOS 应用的示例项目,该项目基于 Mappls 的地图以及其他不同的 SDK。
\n欢迎使用 Mappls iOS SDK
\n探索最大的地图、路线和搜索 API & SDK 目录。
\nMappls 的 API、SDK 以及可实时更新地图数据,适用于 238 个国家,为开发者提供了构建跨平台的更好地图、导航和搜索体验的工具。
\n在本节中,您将找到有关以下内容的文档:-
\nMapplsMap
是一个 SDK,用于显示地图、标记位置、使用自定义数据增强以及甚至在上面对路径或其他形状进行绘制。
Mappls的iOS地图SDK让您轻松地将Mappls地图和Web服务添加到自己的iOS应用中。Mappls的iOS地图SDK支持iOS SDK 9.0及以上版本和Xcode 10.1或更高版本。您可以通过使用Mappls Maps iOS应用,查看您自己在应用中获得地图和功能。SDK处理地图瓦片下载和显示,以及一系列控制和原生手势。
\n版本 | 日期 | 描述 |
---|---|---|
5.13.9 | 2023年6月7日 | 修复错误及改进。 |
5.13.8 | 2023年5月30日 | API域名变更。 |
5.13.7 | 2023年5月2日 | 性能改进和优化。 |
5.13.6 | 2023年3月20日 | 性能改进和优化。 |
5.13.5 | 2023年1月31日 | 修复 - 未调用[C]6C,并添加了一个类[C]7C,该类可以用于使用方法[C]8C初始化SDK。 |
[C]9C | 2022年10月13日 | 在地图单击代理函数[C]11C中提供[C]10C。性能改进和优化。 |
[C]12C | 2022年9月8日 | 问题已解决:在手机处于锁定状态时,CarPlay无法加载瓦片。 |
[C]13C | 2022年8月18日 | 已解决错误:会话未重置。 |
[C]14C | 2022年7月20日 | 已解决错误:重复的Bundle ID。 |
[C]15C | 2022年6月11日 | Mappls地图首次发行。 |
[C]99C
\n在使用任何MAPPL的SDK之前,需要设置Mappls密钥。请参阅以下文档此处。
\n可以将类22C用于授权地图。
\n建议在初始化23C之前调用此方法。
\nSwift
\nObjective-C
\n注意:虽然地图的授权在初始化24C时内部完成,但在105C时仍需要授权。
\n可以在视图控制器中通过接口或编程方式添加地图视图。
\n在故事板中,将一个视图添加到视图控制器中。在标识符检查器中,将其类别更改为“-25C”。
在加载地图时需要设置地图样式URL
要在视图控制器中添加地图,创建一个“-26C”实例,并将其添加到“-27C”的视图中。
\n-109C 要处理应用程序传输安全异常,请将“-28C”添加到您项目的“Info.plist”中。如下
\n¨C29C
缩放级别设置为4以显示国家级别,设置为18以显示门牌号码。
\n设置地图中心的参考代码如下
\n为了在地图上显示用户的当前位置,请使用属性-30C,并将其值设置为true。
\n要随着用户位置的变化移动地图,请使用属性-31C。它是一个枚举属性,类型为-32C。可以从以下值中设置任何值
\n地图对象应实现对应希望接收的事件的 -36C 协议中的方法。此代理还可以用来检测地图覆盖物的选择。代理处理手势事件、标记(标注)上的点击和地图中心坐标。
\n¨C37C
此代理函数将在地图授权过程完成后被调用。它返回成功或错误。
\n¨C121C
\n¨C123C
\n通知代理,地图视图将开始加载。
\n每当地图视图开始加载时,此方法都会被调用,包括设置新样式和地图必须重新加载的情况。
\n—125C
\n—127C
\n通知代理,地图视图已加载完成。
\n每当地图视图完成加载,无论是最初加载还是样式更改强制重新加载后,都会调用此方法。
\n—129C
\n—131C
\n通知代理,地图视图无法加载显示地图所需的数据。
\n此方法可能由于多种原因而被调用,包括网络连接失败或从服务器获取样式失败。您可以使用提供的错误信息通知用户地图数据不可用。
\n—133C
\n—135C
\n通知代理,地图视图即将重新绘制。
\n每当地图视图因视图或样式属性过渡需要重新绘制时,都会调用此方法。此方法可能非常频繁地被调用。因此,您对此方法的实现应尽可能轻量,以避免影响性能。
\n—137C
\n—139C
\n通知代理,地图视图刚刚重新绘制。
\n每当地图视图因视图或样式属性过渡需要重新绘制时,都会调用此方法。此方法可能非常频繁地被调用。因此,您对此方法的实现应尽可能轻量,以避免影响性能。
\n-141C
\n-143C
\n通知代理,地图视图正进入空闲状态,在加载新数据或与地图进行交互之前将不再进行绘制。
\n-145C
\n-147C
\n通知代理,地图刚刚加载完样式。
\n此方法在地图视图初始化期间和加载任何新的样式之后被调用。
\n-149C
\n-151C
\n此代理函数给出 -38C。
\n此方法在地图上点击时调用,提供字符串值(Mappls Pin)或空值(如果未找到Mappls Pin)。
\n-153C
\n-155C
\n地图将出现以下错误代码
\n¨C39C
¨C40C
¨C41C
¨C42C
¨C43C
要捕获地图上的单次点击事件,请向“-44C”实例添加一个点击手势。被点击的CGPoint可以转换为CLLocationCoordinate对象。此外,如果点击区域内有任何标记,也可以检索到。以下代码用于说明上述功能:
\n要捕获地图上的长按事件,请向实例中的 ¨C45C 添加一个长按手势。
\n要在地图上显示注释,创建实例 ¨C46C 并使用方法 ¨C48C 将该对象添加到实例 ¨C47C中。
\n创建实例 ¨C49C 后,设置坐标和标题属性的值。
\n要更改默认标记的图片,可以使用协议的代理方法
\n°C50C.\n您可以通过使用下面的代理方法来完全覆盖标记视图
¨C51C
或者,您可以覆盖标记的图片,使用下面的代理方法
\n¨C52C
要在标记上点击时启用信息窗口,请从下面的代理方法返回true
\n要更改注释的默认调用视图,请使用 ¬53C 协议的代理函数,并从该函数中返回自定义调用视图。
\n要创建自定义调用视图,创建一个继承自 ¬54C 和 ¬55C 的类。覆盖 ¬56C 的 draw 函数来自定义调用视图。
\n要在地图上显示多边形线,创建一个 ¬57C 的实例,并使用 ¬59C 方法将其对象添加到 ¬58C 的实例。
\n要创建 ¬60C 的实例,需要一个 ¬61C 的数组,因此首先创建一个 ¬62C 的数组。
\n在渲染多段线注释的轮廓时,可以设置点的线宽度。这可以通过使用代理方法 -63C 实现。
\n默认情况下,多段线轮廓的线宽为3.0个点。
\n要在地图上显示多边形,请创建一个实例化的对象¬64C并将此对象添加到¬65C实例中,使用¬66C方法。
\n要创建¬67C实例,需要一个¬68C数组,因此首先创建一个¬69C数组。
\n通过设置可见区域,使地图显示指定的注释。
\n使用对象”创建相机形状”的函数”C71C”可以检索与指定形状最匹配的相机对象,同时在每侧添加一定的填充,并朝指定方向查看。
\n使用上述函数创建相机对象后,可以将其设置为适合地图可见区域。
\n使用代理方法ªC75C可以改变ªC73C的颜色以及ªC74C的轮廓颜色。
\n默认的轮廓颜色是地图视图的色调颜色。
\n使用委托方法 -77C 可以更改 -76C 的填充颜色。
\n默认填充颜色是地图查看器的色调颜色。
\n要更改形状的透明度(例如折线或多边形),可以使用委托方法 -78C。
\n这将设置整个形状的透明度,包括其边框和填充。
\n根据用户的地理位置,可以在地图上显示安全状态条。当前正在显示COVID-19状态,会显示用户的位置是否位于防控区域以及防控区域信息,如防控区域名称、区域等。有关如何使用更多信息,请参阅安全条。
\n可以配置Map SDK,使其仅对设备的指定唯一标识符工作,并相应地显示错误。
\n可以使用作为Map SDK依赖的一部分的单例类—79C设置和检索集群标识符。
\n以下为设置和获取集群标识符的代码示例。
\n在设计时添加地图标注,请在以下结构体中添加一个98C属性:
\n¨C87C
请使用以下代码在设计时通过设置标注属性添加标记。
\n¨C88C
为了响应用户地图事件,例如在MapView初始化完成后执行操作。在SwiftUI中,可以使用协调器及其代理、数据源和用户事件。UIViewRepresentable协议定义了makeCoordinator()方法,用于创建协调器实例。添加以下代码声明协调器类
\n¨C89C
然后向SwiftUI视图添加以下方法
\n¨C90C
最后,将参考协调器设置在Mappls地图视图中。
\n¨C91C
如有任何疑问或需要支持,请联系我们
\n\n通过以下邮箱联系我们 [email protected]
\n\n支持\n需要支持?请联系我们!