2016-11-22 1 views
0

그래서 나는 firstPath, secondPath 및 thirdPath이있는 경우이 같은 새 경로를 만들 수 있습니다!경로를 서로 결합 (추가) 할 수 있습니까?</p> <pre><code>finalPath = firstPath finalPath.append(secondPath) finalPath.append(thirdPath) </code></pre> <p>감사 :

난 그냥 함께 갈 것이 일을 생각할 수있는 유일한 다른 방법 :

for coord in firstPath 
{ 
finalPath.add(coord) 
} 

for coord in secondPath 
{ 
finalPath.add(coord) 
} 

for coord in thirdPath 
{ 
finalPath.add(coord) 
} 

하고는 지루한 것 같다

+0

무엇 타입이'firstPath'입니까? 그렇지 않으면 질문에 대답 할 수있는 대부분의 사람들은 배경 부족으로 인해 할 수 없습니다. 우리들 대부분은 Google지도 SDK에 익숙하지 않습니다. – Alexander

+0

모든 "경로"는 GMSMutablePath 유형입니다. – skyleguy

답변

0

중첩 할 수 있습니다 귀하의 루프 :

for path in [firstPath, secondPath, thirdPath] { 
    for coord in path { 
     finalPath.add(coord) 
    } 
}