iOS에서 작동하지 않는 Flash 용 Google지도 API의 해결 방법으로 Flex 모바일 응용 프로그램에서 Google지도 Javascript API를 사용하여 StageWebView를로드하려고합니다. stageWebView.loadString() 메서드를 사용하고 있습니다. 다음은 HTML.Javascript가로드되는 관련 부분입니다.Google지도 JS API v3이 Flex Mobile 내에서로드되지 않습니다. StageWebView
내 문제는 브라우저 (IE, Chrome 및 Safari) 및 Flash Builder iPhone/iPad 시뮬레이터에서이 문제를 완벽하게 처리한다는 것입니다. 실제 장치에서는 맵이로드되지 않고 일부 try..catch 문을 통해 "TypeError : '정의되지 않은'은 생성자가 아닙니다."라는 오류를 식별 할 수있었습니다.이 오류는 내부에 나열된 각 행에 의해 throw됩니다. 아래의 초기화 함수.
무엇이 잘못 될지에 대한 의견이 있으십니까?
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?v=3&key=MY_KEY&sensor=true">
</script>
<script type="text/javascript">
/* a bunch of variables and functions */
function initialize() {
var myOptions = { center: new google.maps.LatLng(43.476302, -80.4816062), zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP };
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
geocoder = new google.maps.Geocoder();
dirDisplay = new google.maps.DirectionsRenderer();
/* some other stuff */
}
if(window.addEventListener) window.addEventListener("load", initialize, true); else window.onload = initialize;
</script>
</head>
<body>
<div id="map_canvas" style="width:100%; height:100%;" ></div>
<div id="dirPanel" style="width:100%;" ></div>
</body>
</html>
편집 : 나는에서는 google.maps가 포함 된 개체를 어떻게 확인하고 찾을 수 놀랐습니다 그 객체가 Map
, Polyline
, Marker
, Geocoder
으로, 브라우저에 나타나는와는 달리 다른 자식 객체의 호스트, 이 다른 이유에
google.maps {
modules:Object,
Load:function (apiLoad) { delete google.maps.Load; apiLoad([/*lots of stuff I don't feel like copying out by hand*/], loadScriptTime); },
_gjsload_:function (name, text) { modules[name] = text; }
}
어떤 생각을 : 아이폰 OS 장치에 의해 bpresented 버전은 다음과 같습니다? 또는지도 API가 작동하도록하려면 어떻게해야합니까?
Google은 Flash/Flex Maps API를 더 이상 지원하지 않으며 모든 사용자에게 JS Maps API 사용을 권장합니다. –