Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2023-07-24 16:25:05 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
64cec12669430b64f26fba4af6ed29f360515a15
64cec126
1 parent
b82641a0
add mulitple parentMerchants at MapVC
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
View file @
64cec12
...
...
@@ -34,6 +34,7 @@ import MapKit
var
selectedMerchant
:
swiftApi
.
MerchantModel
?
var
annotationGroup
=
[
MKPointAnnotation
]()
var
parentMerchant
:
swiftApi
.
MerchantModel
?
var
parentMerchantsArray
:
Array
<
swiftApi
.
MerchantModel
>
=
[]
//
var
loading
:
Bool
=
false
...
...
@@ -158,13 +159,15 @@ import MapKit
DispatchQueue
.
main
.
async
{
let
filteredMerchants
=
(
merchantsData
??
[])
.
filter
({
return
((
$0
.
_latitude
!=
0.0
)
&&
(
$0
.
_longitude
!=
0.0
))
})
let
parentMerchants
=
(
merchantsData
??
[])
.
filter
({
return
((
$0
.
_latitude
==
0.0
)
&&
(
$0
.
_longitude
==
0.0
))
})
// if (self.isMarket == true) {
self
.
merchantsArray
=
filteredMerchants
if
let
parent
=
(
merchantsData
??
[])
.
first
(
where
:
{((
$0
.
_latitude
==
0.0
)
&&
(
$0
.
_longitude
==
0.0
))})
{
self
.
parentMerchant
=
parent
}
self
.
parentMerchantsArray
=
parentMerchants
// if let parent = (merchantsData ?? []).first(where: {(($0._latitude == 0.0) && ($0._longitude == 0.0))}) {
// self.parentMerchant = parent
// }
// } else {
// self.merchantsArray = merchantsData ?? []
...
...
@@ -328,6 +331,10 @@ import MapKit
private
func
loadPinDetailsView
(
_
annotation
:
MerchantAnnotation
)
{
self
.
selectedMerchant
=
annotation
.
model
if
let
parent
=
self
.
parentMerchantsArray
.
first
(
where
:
{(
$0
.
_uuid
==
self
.
selectedMerchant
?
.
_parent
)})
{
self
.
parentMerchant
=
parent
}
// self.titleView.text = self.selectedMerchant?._admin_name
self
.
titleView
.
text
=
self
.
parentMerchant
?
.
_admin_name
...
...
Please
register
or
login
to post a comment