MapplsMap 5.13.13

MapplsMap 5.13.13

MapmyIndiaMapmyIndiaMapmyIndiaMapmyIndia 维护。




MapplsMap 5.13.13

{"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":"

\n

Mappls Map SDK

\n

介绍

\n

此仓库包含了一个 iOS 应用的示例项目,该项目基于 Mappls 的地图以及其他不同的 SDK。

\n

欢迎使用 Mappls iOS SDK

\n

探索最大的地图、路线和搜索 API & SDK 目录。

\n

Mappls 的 API、SDK 以及可实时更新地图数据,适用于 238 个国家,为开发者提供了构建跨平台的更好地图、导航和搜索体验的工具。

\n

在本节中,您将找到有关以下内容的文档:-

\n
    \n
  • 关于 Vector iOS 地图集成的详细信息。
  • \n
  • REST API 模块是开发者消耗我们 RESTful API 的自定义模块,易于使用,无需从头开发此类功能。
  • \n
  • 关于如何集成 Mappls 小部件的详细信息。
  • \n
\n

Map SDK

\n

MapplsMap 是一个 SDK,用于显示地图、标记位置、使用自定义数据增强以及甚至在上面对路径或其他形状进行绘制。

\n

开始使用

\n

Mappls的iOS地图SDK让您轻松地将Mappls地图和Web服务添加到自己的iOS应用中。Mappls的iOS地图SDK支持iOS SDK 9.0及以上版本和Xcode 10.1或更高版本。您可以通过使用Mappls Maps iOS应用,查看您自己在应用中获得地图和功能。SDK处理地图瓦片下载和显示,以及一系列控制和原生手势。

\n

版本历史

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
版本日期描述
5.13.92023年6月7日修复错误及改进。
5.13.82023年5月30日API域名变更。
5.13.72023年5月2日性能改进和优化。
5.13.62023年3月20日性能改进和优化。
5.13.52023年1月31日修复 - 未调用[C]6C,并添加了一个类[C]7C,该类可以用于使用方法[C]8C初始化SDK。
[C]9C2022年10月13日在地图单击代理函数[C]11C中提供[C]10C。性能改进和优化。
[C]12C2022年9月8日问题已解决:在手机处于锁定状态时,CarPlay无法加载瓦片。
[C]13C2022年8月18日已解决错误:会话未重置。
[C]14C2022年7月20日已解决错误:重复的Bundle ID。
[C]15C2022年6月11日Mappls地图首次发行。
\n

配置您的项目

\n

在Xcode中创建新项目。

\n
    \n[C]97C\n[C]98C\n
\n

[C]99C

\n
    \n[C]100C\n[C]101C\n
\n\n[C]102C\n\n

授权

\n

MapplsAPICore

\n

在使用任何MAPPL的SDK之前,需要设置Mappls密钥。请参阅以下文档此处

\n

MapplsMap

\n

可以将类22C用于授权地图。

\n

建议在初始化23C之前调用此方法。

\n

Swift

\n
103C
\n

Objective-C

\n
104C
\n

注意:虽然地图的授权在初始化24C时内部完成,但在105C时仍需要授权。

\n

用法

\n

添加Mappls地图视图

\n

可以在视图控制器中通过接口或编程方式添加地图视图。

\n

通过界面构建器

\n

在故事板中,将一个视图添加到视图控制器中。在标识符检查器中,将其类别更改为“-25C”。
在加载地图时需要设置地图样式URL

\n

通过程序化

\n

要在视图控制器中添加地图,创建一个“-26C”实例,并将其添加到“-27C”的视图中。

\n

Objective-C

\n
-107C
\n

Swift

\n
-108C
\n

-109C 要处理应用程序传输安全异常,请将“-28C”添加到您项目的“Info.plist”中。如下

\n
¨C29C
\n

地图交互

\n

地图功能

\n

当前位置

\n

为了在地图上显示用户的当前位置,请使用属性-30C,并将其值设置为true。

\n

Objective-C

\n
-114C
\n

Swift

\n
-115C
\n

跟踪模式

\n

要随着用户位置的变化移动地图,请使用属性-31C。它是一个枚举属性,类型为-32C。可以从以下值中设置任何值

\n
    \n

    Objective-C

    \n
    -119C
    \n

    Swift

    \n
    ¨C120C
    \n

    地图事件

    \n

    地图对象应实现对应希望接收的事件的 -36C 协议中的方法。此代理还可以用来检测地图覆盖物的选择。代理处理手势事件、标记(标注)上的点击和地图中心坐标。

    \n

    地图位置变化事件

    \n
    ¨C37C
    \n

    加载地图事件

    \n

    -authorizationCompleted:withError:

    \n

    此代理函数将在地图授权过程完成后被调用。它返回成功或错误。

    \n

    ¨C121C

    \n
    ¨C122C
    \n

    ¨C123C

    \n
    ¨C124C
    \n

    -mapViewWillStartLoadingMap:

    \n

    通知代理,地图视图将开始加载。

    \n

    每当地图视图开始加载时,此方法都会被调用,包括设置新样式和地图必须重新加载的情况。

    \n

    —125C

    \n
    —126C
    \n

    —127C

    \n
    —128C
    \n

    -mapViewDidFinishLoadingMap:

    \n

    通知代理,地图视图已加载完成。

    \n

    每当地图视图完成加载,无论是最初加载还是样式更改强制重新加载后,都会调用此方法。

    \n

    —129C

    \n
    —130C
    \n

    —131C

    \n
    —132C
    \n

    -mapViewDidFailLoadingMap:withError:

    \n

    通知代理,地图视图无法加载显示地图所需的数据。

    \n

    此方法可能由于多种原因而被调用,包括网络连接失败或从服务器获取样式失败。您可以使用提供的错误信息通知用户地图数据不可用。

    \n

    —133C

    \n
    —134C
    \n

    —135C

    \n
    —136C
    \n

    -mapViewWillStartRenderingFrame:

    \n

    通知代理,地图视图即将重新绘制。

    \n

    每当地图视图因视图或样式属性过渡需要重新绘制时,都会调用此方法。此方法可能非常频繁地被调用。因此,您对此方法的实现应尽可能轻量,以避免影响性能。

    \n

    —137C

    \n
    —138C
    \n

    —139C

    \n
    —140C
    \n

    -mapViewDidFinishRenderingFrame:fullyRendered:

    \n

    通知代理,地图视图刚刚重新绘制。

    \n

    每当地图视图因视图或样式属性过渡需要重新绘制时,都会调用此方法。此方法可能非常频繁地被调用。因此,您对此方法的实现应尽可能轻量,以避免影响性能。

    \n

    -141C

    \n
    -142C
    \n

    -143C

    \n
    -144C
    \n

    -mapViewDidBecomeIdle:

    \n

    通知代理,地图视图正进入空闲状态,在加载新数据或与地图进行交互之前将不再进行绘制。

    \n

    -145C

    \n
    -146C
    \n

    -147C

    \n
    -148C
    \n

    -mapView:didFinishLoadingStyle:

    \n

    通知代理,地图刚刚加载完样式。

    \n

    此方法在地图视图初始化期间和加载任何新的样式之后被调用。

    \n

    -149C

    \n
    -150C
    \n

    -151C

    \n
    -152C
    \n

    -mapView:didTapPlaceWithMapplsPin:

    \n

    此代理函数给出 -38C。

    \n

    此方法在地图上点击时调用,提供字符串值(Mappls Pin)或空值(如果未找到Mappls Pin)。

    \n

    -153C

    \n
    -154C
    \n

    -155C

    \n
    -156C
    \n

    SDK 错误代码

    \n

    地图将出现以下错误代码

    \n
      ¨C157C
    \n

    跟踪用户位置事件

    \n
    ¨C39C
    \n

    标注出现事件

    \n
    ¨C40C
    \n

    注释视图事件

    \n
    ¨C41C
    \n

    选择标注事件

    \n
    ¨C42C
    \n

    呼出视图事件

    \n
    ¨C43C
    \n

    地图点击事件

    \n

    单次点击手势

    \n

    要捕获地图上的单次点击事件,请向“-44C”实例添加一个点击手势。被点击的CGPoint可以转换为CLLocationCoordinate对象。此外,如果点击区域内有任何标记,也可以检索到。以下代码用于说明上述功能:

    \n

    Objective C

    \n
    -164C
    \n

    Swift

    \n
    @objc func didTapMap(tap: UITapGestureRecognizer) {\n if tap.state == .ended {\n let point = tap.location(in: mapView)\n\n // 将点击区域点转换为CLLocationCoordinate对象\n let coordinate = mapView.convert(point, toCoordinateFrom: mapView)\n\n // 还可以使用点击区域点检查存在的注释或功能\n let visibleFeatures = mapView.visibleFeatures(at: point)\n if visibleFeatures.count > 0 {\n\n }\n }\n}">-165C
    \n

    长按手势

    \n

    要捕获地图上的长按事件,请向实例中的 ¨C45C 添加一个长按手势。

    \n

    Objective C

    \n
    ¨C166C
    \n

    Swift

    \n
    ¨C167C
    \n

    Map Overlays

    \n

    添加标记

    \n

    要在地图上显示注释,创建实例 ¨C46C 并使用方法 ¨C48C 将该对象添加到实例 ¨C47C中。

    \n

    创建实例 ¨C49C 后,设置坐标和标题属性的值。

    \n

    Objective C

    \n
    ¨C168C
    \n

    Swift

    \n
    ¨C169C
    \n

    移除标记

    \n

    Objective C

    \n
    °C170C
    \n

    Swift

    \n
    °C171C
    \n

    自定义标记(更改默认标记图标)

    \n

    要更改默认标记的图片,可以使用协议的代理方法
    \n°C50C.\n您可以通过使用下面的代理方法来完全覆盖标记视图

    \n
    ¨C51C
    \n

    或者,您可以覆盖标记的图片,使用下面的代理方法

    \n
    ¨C52C
    \n

    显示信息窗口(呼出)

    \n

    要在标记上点击时启用信息窗口,请从下面的代理方法返回true

    \n
    °C172C
    \n

    自定义信息窗口(#Custom-Info-Window)

    \n

    要更改注释的默认调用视图,请使用 ¬53C 协议的代理函数,并从该函数中返回自定义调用视图。

    \n
    ¬173C
    \n

    要创建自定义调用视图,创建一个继承自 ¬54C 和 ¬55C 的类。覆盖 ¬56C 的 draw 函数来自定义调用视图。

    \n

    多边形线

    \n

    添加多边形线

    \n

    要在地图上显示多边形线,创建一个 ¬57C 的实例,并使用 ¬59C 方法将其对象添加到 ¬58C 的实例。

    \n

    要创建 ¬60C 的实例,需要一个 ¬61C 的数组,因此首先创建一个 ¬62C 的数组。

    \n

    Objective C

    \n
    ¬174C
    \n

    Swift

    \n
    ¬175C
    \n

    移除多段线

    \n

    Objective C

    \n
    roperty C
    \n

    Swift

    \n
    roperty C
    \n

    多段线宽度

    \n

    在渲染多段线注释的轮廓时,可以设置点的线宽度。这可以通过使用代理方法 -63C 实现。

    \n

    默认情况下,多段线轮廓的线宽为3.0个点。

    \n

    Objective C

    \n
    PERTY C
    \n

    Swift

    \n
    PERTY C
    \n

    多边形

    \n

    添加多边形

    \n

    要在地图上显示多边形,请创建一个实例化的对象¬64C并将此对象添加到¬65C实例中,使用¬66C方法。

    \n

    要创建¬67C实例,需要一个¬68C数组,因此首先创建一个¬69C数组。

    \n

    Objective C

    \n
    ¬180C
    \n

    Swift

    \n
    ¬181C
    \n

    删除多边形

    \n

    Objective C

    \n
    ¬182C
    \n

    Swift

    \n
    ©183C
    \n

    Map Camera

    \n

    Fit Map Camera

    \n

    通过设置可见区域,使地图显示指定的注释。

    \n

    Swift

    \n
    ©184C
    \n

    Create Camera For Shape

    \n

    使用对象”创建相机形状”的函数”C71C”可以检索与指定形状最匹配的相机对象,同时在每侧添加一定的填充,并朝指定方向查看。

    \n

    使用上述函数创建相机对象后,可以将其设置为适合地图可见区域。

    \n

    Objective C

    \n
    ªC185C
    \n

    Swift

    \n
    ªC186C
    \n

    杂项

    \n

    形状轮廓颜色

    \n

    使用代理方法ªC75C可以改变ªC73C的颜色以及ªC74C的轮廓颜色。

    \n

    默认的轮廓颜色是地图视图的色调颜色。

    \n

    Objective C

    \n
    ªC187C
    \n

    Swift

    \n
    ªC188C
    \n

    形状填充颜色

    \n

    使用委托方法 -77C 可以更改 -76C 的填充颜色。

    \n

    默认填充颜色是地图查看器的色调颜色。

    \n

    Objective C

    \n
    -189C
    \n

    Swift

    \n
    -190C
    \n

    形状透明度

    \n

    要更改形状的透明度(例如折线或多边形),可以使用委托方法 -78C。

    \n

    这将设置整个形状的透明度,包括其边框和填充。

    \n

    Objective C

    \n
    -191C
    \n

    Swift

    \n
    ¨C192C
    \n

    安全状态条

    \n

    根据用户的地理位置,可以在地图上显示安全状态条。当前正在显示COVID-19状态,会显示用户的位置是否位于防控区域以及防控区域信息,如防控区域名称、区域等。有关如何使用更多信息,请参阅安全条

    \n

    基于集群的身份验证

    \n

    可以配置Map SDK,使其仅对设备的指定唯一标识符工作,并相应地显示错误。

    \n

    设置集群设备

    \n

    可以使用作为Map SDK依赖的一部分的单例类—79C设置和检索集群标识符。

    \n

    以下为设置和获取集群标识符的代码示例。

    \n

    Objective C

    \n
    ¨C193C
    \n

    Swift

    \n
    ©194C
    \n

    SwiftUI

    \n

    创建地图视图

    \n
      ©195C©196C©197C©198C
    \n

    在设计时添加地图标注,请在以下结构体中添加一个98C属性:

    \n
    ¨C87C
    \n

    请使用以下代码在设计时通过设置标注属性添加标记。

    \n
    @State var annotations: [MGLPointAnnotation] = [\n MGLPointAnnotation(title: "MAPPLS", coordinate: .init(latitude: 28.550679, longitude: 77.268949))\n ]\n \n var body: some View {\n MapView(annotations: $annotations).centerCoordinate(.init(latitude: 28.550679, longitude: 77.268949)).zoomLevel(16)\n }\n"
    ¨C88C
    \n

    响应用户地图事件

    \n

    为了响应用户地图事件,例如在MapView初始化完成后执行操作。在SwiftUI中,可以使用协调器及其代理、数据源和用户事件。UIViewRepresentable协议定义了makeCoordinator()方法,用于创建协调器实例。添加以下代码声明协调器类

    \n
    ¨C89C
    \n

    然后向SwiftUI视图添加以下方法

    \n
    ¨C90C
    \n

    最后,将参考协调器设置在Mappls地图视图中。

    \n
    ¨C91C
    \n




    \n

    我们的众多满意客户

    \n

    \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"

    \n
    \n

    如有任何疑问或需要支持,请联系我们

    \n

    \n

    通过以下邮箱联系我们 [email protected]

    \n

    \n支持\n需要支持?请联系我们!

    \n



    \n

    \"\"\"\"

    \n

    \"\"\"\"\"\"

    \n
    版权所有 2022 CE Info Systems Pvt. Ltd. 版权所有。
    \n
    ","renderedFileInfo":null,"shortPath":null,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"repoOwner":"mappls-api","repoName":"mappls-ios-sdk","showInvalidCitationWarning":false,"citationHelpUrl":"https://githubdocs.cn/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","showDependabotConfigurationBanner":false,"actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timedOut":false,"notAnalyzed":true,"symbols":[]}},"copilotInfo":null,"csrf_tokens":{"/mappls-api/mappls-ios-sdk/branches":{"post":"34BCoosN16A3PfDmQRnmqi6S6QW5CAfZvuaYQXMnlylrwE9J-vdHLTFMr4xBRDYR7hRi3cKRIHkTdI3-FU12tQ"},"/repos/preferences":{"post":"Jvjw2wG4gvlg_JgMX9NSJRUt38J3hT4aA21j1-6_fLLTP4hG95AcwMONMuYOMrxfQq-cmEfO_5UhuOusxraBTg"}}},"title":"mappls-ios-sdk/docs/v1.0.14/MapplsMap.md at main · mappls-api/mappls-ios-sdk"}