2011-07-05 3 views
3

저는 성공적으로 제 문제에 대한 답변을 찾고있었습니다. 여기에 있습니다 ...KMLViewer Apple의 예제가 작동하지 않습니다.

KMLViewer, 일부 사례에서는 Apple의 사례가 작동하지 않습니다. README 단계를 실행 한 후 포르투갈리스 보아와 포르투갈의 포르토 간 경로를 구축하려했습니다. 그리고 여기서 가장 이상한 일이 일어납니다. 오버레이 (MKPolyline)는 아니지만 경로의 일부만 그렸고 주석 (annotation)의 중간에 그림이 시작되지만 주석은 올바르게 작성됩니다.

내가 무엇이 누락 되었습니까? 마드리드 - 바르셀로나도 시도해 볼 수 있습니다. 같은 문제가 있습니다.

이 문제에서 언젠가는 지출에 미리 감사드립니다.

답변

2

PlacemarkLineString 개체 만 KMLViewer에서 처리 할 수 ​​있습니다.

시도한 경로의 경우 Google은 '경로'장소 표시 (파일의 마지막 위치 표시)에 두 개의 LineString 객체를 반환합니다. KMLViewer는 두 번째 (마지막) LineString 세그먼트 만 표시합니다. 이외에도 (좋은 운동과 같은) 위치 표시 당 여러 개의 선 스트링 객체에 대한 지원을 추가 할 KMLViewer 코드를 업데이트

, 당신은이 두 가지 해결 방법을 시도 할 수 있습니다 :

한 유도 선에 두 개의 선 스트링 객체에서 좌표를 결합 . 변경 : 이것에

<Placemark> 
    <name>Route</name> 
    <description>some cdata stuff here</description> 
    <GeometryCollection> 
     <LineString><coordinates>coord1 … coordN</coordinates></LineString> 
     <LineString><coordinates>coordN+1 … coordK</coordinates></LineString> 
    </GeometryCollection> 
    <styleUrl>#roadStyle</styleUrl> 
</Placemark> 

:

<Placemark> 
    <name>Route</name> 
    <description>some cdata stuff here</description> 
    <GeometryCollection> 
     <LineString><coordinates>coord1 … coordN coordN+1 … coordK</coordinates></LineString> 
    </GeometryCollection> 
    <styleUrl>#roadStyle</styleUrl> 
</Placemark> 

은 위의 유일한 연속 있어야하는 경로 (선분)에 적합 할 수 있습니다.

다른 해결 방법은 (각 유도 선 하나를) 여러 장소 표시에 "경로"위치 표시를 분할하는 것입니다 :이와

<Placemark> 
    <name>Route A</name> 
    <description>some cdata stuff here</description> 
    <GeometryCollection> 
     <LineString><coordinates>coord1 … coordN</coordinates></LineString> 
    </GeometryCollection> 
    <styleUrl>#roadStyle</styleUrl> 
</Placemark> 
<Placemark> 
    <name>Route B</name> 
    <description>some cdata stuff here</description> 
    <GeometryCollection> 
     <LineString><coordinates>coordN+1 … coordK</coordinates></LineString> 
    </GeometryCollection> 
    <styleUrl>#roadStyle</styleUrl> 
</Placemark> 

한 가지 문제는 그 거리와 시간 정보가 일치하지 않습니다 들어있는 "설명" 분할 된 경로.

+0

답변에 대한 Thx 좋은 도움이되었습니다! – aGit

1

넵. 빠른 응답을 보내 주셔서 감사합니다. 내가 문제가 함께 이러한 태그 (가까운 & 개방)입니다 아침에 발견 한

</coordinates></LineString><LineString><coordinates> 

내 계획 : 위의 태그를 존재하는 경우

을 저장있는 NSString에 URL의 출력은, 제거, 나중에 파일에 저장하여 KMLParser로 보냅니다. 내가 끝나면 돌아올거야.

다시 한 번 답장을 보내 주셔서 감사합니다.

+0

내가이 일을 해결했다면, 내가 한 일을 이해하기 위해 더 많은 도움이 필요하면, 그냥 나에게 :) – aGit

관련 문제