에 구글 맵을 통합 할 수있는 좋은 방법이 있나요 오픈 라즐로 http://code.google.com/p/openlaszloincubator/source/browse/trunk/googlemapsonlaszlo/?r=32#googlemapsonlaszlo%253Fstate%253Dclosed 과 사이트에 대한 사용을 2.0? 내가 그것을 검색 아파치 openmeetings에 구글 맵을 통합하고 찾을 수있는 좋은 방법이 있나요 http://code.google.com/p/openmeetings/source/browse/trunk/singlewebapp/WebContent/lps/components/incubator/googlemap.lzx?r=3529 어떤 오픈 메이킹 2.0을 기반으로하지 않습니다! 아무도 그것을 실현합니까?아파치 openmeetings 2.0?
답변
구글은 deprecated the Google Maps Flash APIs in late 2011 있습니다.
는 "결과적으로 우리가 앞으로 을가는 자바 스크립트지도 API v3에서 우리의 관심을 집중 위해 Flash 용지도 API를 더 이상 사용하기로 결정했습니다. 이것은 Flash 응용 프로그램에 대한지도 API가 가 계속되지만에서 작동하는 것을 의미한다 지도 API 서비스 약관에서 에 제공되는 비추천 정책에 따라 의 새로운 기능은 개발되지 않으며 중요한 버그, 회귀 및 보안 문제는 으로 고정 될 것입니다. 기존 Google지도 API 에 대한 지원을 계속 제공 할 것입니다. Flash 용지도 API를 사용하는 프리미어 고객은 개발자 관계가 만료됩니다. Flash 용 Maps API 포럼 참여. "
따라서 기존 Google Maps API Premier 고객이 아닌 경우 Google Maps OpenLaszlo component in the incubator을 사용할 수 없습니다. 대신 Google JavaScript Maps API v3을 사용해야합니다. SWF 런타임에서 <html /> tag을 사용하여지도 객체를 통합 할 수 있습니다. DHTML 런타임 만 사용하려는 경우 맵 객체를 뷰의 표시 객체에 직접 첨부 할 수 있습니다.
현재 OpenMeetings 버전은 SWF 런타임을 기본 대상 런타임으로 사용하고 있으므로 <html src="" />
태그를 사용하여 iFrame을 사용할 수 있습니다.
다음은 댓글에 사용한 코드를 기반으로 한 간단한 예입니다. 이 예제는 두 개의 파일을 사용합니다 : 하나의 LZX 파일과 Google Maps 예제를 포함하는 하나의 HTML 파일.
버튼을 클릭 할<!DOCTYPE html>
<html>
<head>
<title>Google Maps JavaScript API v3 Example: Map Simple</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map_canvas {
margin: 0;
padding: 0;
height: 100%;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
}
function centerMap(lat, lng) {
map.setCenter(new google.maps.LatLng(lat, lng));
map.setZoom(11);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map_canvas"></div>
</body>
</html>
의 오픈 라즐로 애플 리케이션의 기능 centerMap(lat, lng)
를 호출 iframe이에로드
<canvas height="500">
<class name="showGISWindow"
extends="view"
width="464" height="440">
<method name="setLatLong" args="lat,lng">
this.maps.callJavascript('centerMap(' + lat + ', ' + lng + ')');
</method>
<button text="Show New York"
align="center"
onclick="parent.setLatLong(40.69847032728747, -73.9514422416687)" />
<html name="maps" src="gmaps.html"
x="15" y="45"
width="${parent.width - 30}"
height="${parent.height - 45}" />
</class>
<showGISWindow id="gis" x="10" y="10" />
</canvas>
그리고 해당 gmaps.html 페이지의 콘텐츠, 다음은 LZX 코드는 HTML 페이지를 열고 뉴욕으로지도를 중앙에 배치합니다. 다음은 응용 프로그램의 스크린 샷은 SWF10 런타임에서의 :
들으, 라주가 쓴! 나는 lzx 파일을 쓴다. \t \t \t \t <버튼 텍스트"('SRC를', 'http://ditu.google.cn/') "/> \t \t 창을 표시 할 때 html을로드 할 수 없습니다. "WARNING @ extensions/html.lzx≈29 : 정의되지 않은 속성 '[]'에 대한 참조가 잘못 표시 되었습니까? –
feythin
답안에 Google지도 코드가 들어있는 해당 HTML 파일과 함께 LZX 응용 프로그램 예제를 추가했습니다. –
당신의 제안을위한 thx! LZX 파일에서 위에 제시 한 코드는 canvas 태그를 가지고 있습니다. openmeetings는 main.lzx에서 하나의 캔버스 태그 만 가질 수 있습니다. 그래서 내 질문은 openmeetings 응용 프로그램에 intergrate하는 방법입니다 새로운 하나를 열지 마! 고마워! – feythin