2012-04-27 2 views
0

HTML 페이지에 Google 어스 JavaScript 플러그인을 삽입하면 Google 어스 플러그인 아래에 일련의 HTML 링크를 사용하여 Google 어스 탐색을 복제 할 수 있습니까?외부 버튼을 사용하여 Google 어스 플러그인 탐색 기능 복제

Google Earth Navigation

나는 4 개 주 이동 방향을 찾는 버튼의 카메라 기울기에 대한 상하 (위, 아래, 왼쪽, 오른쪽)와, 슬라이더없이, 줌 버튼 기능에게 필요한 것입니다.

회전은 항상 북쪽에 머무를 수 있습니다. 필요하지 않습니다.

버튼의 샘플.

<div id="map3d" style="height: 400px;"></div> 
<h3>Look</h3> 
<a href="#" class="btn" id="up">up</a> 
<a href="#" class="btn" id="right">right</a> 
<a href="#" class="btn" id="down">down</a> 
<a href="#" class="btn" id="left">left</a> 
<h3>Move</h3> 
<a href="#" class="btn" id="north">north</a> 
<a href="#" class="btn" id="east">east</a> 
<a href="#" class="btn" id="west">west</a> 
<a href="#" class="btn" id="south">south</a> 
<h3>Zoom</h3> 
<a href="#" class="btn" id="zoomIn">Zoom In</a> 
<a href="#" class="btn" id="zoomOut">Zoom Out</a> 

답변

1

예, 카메라 매개 변수 만 변경할 수 있습니다.

참조 : https://developers.google.com/earth/documentation/camera_control

는 기본적으로 현재보기를 얻고, 어느 새 자리로 변경하거나 조정 (즉, 버튼을 클릭 할 때마다, 이동 X 학위 또는 뭔가.).

// Get the current view. 
var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND); 

// Add 25 degrees to the current latitude and longitude values. 
lookAt.setLatitude(lookAt.getLatitude() + 25.0); 
lookAt.setLongitude(lookAt.getLongitude() + 25.0); 

// Update the view in Google Earth. 
ge.getView().setAbstractView(lookAt); 
: 경우에 여기에 복사 위의 링크에서

코드는 나중에 변경

관련 문제