0
나는이 페이지를 여는 링크에 rel = "external"을 수행하므로 많은 문제를 배제해야하는 DOM이 다시로드됩니다.jquery 모바일에서 내 Google지도를로드 할 수없는 이유는 무엇입니까?
그럼에도 불구하고 다음 코드를 사용하면 멋진 머리글과 바닥 글이있는 거대한 빨간색 배경이 생깁니다.지도가 초기화되지 않지만 이 호출되는데이 호출됩니다. 누구든지 문제를 발견 할 수 있습니까? 이 버그로 인해 나를 영원히 붙잡고 있습니다. rel = "external"가 아닌 다중 페이지 템플리트로 재 설계하는 것을 포함하여 백만 가지를 시도했지만 그 중 하나도 작동하지 않았습니다.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css"/>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript">
$(function(){initializeMap(42,-73);});
function initializeMap(lat,lng) {
var latlng = new google.maps.LatLng(lat, lng);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
var crosshairLayer = new google.maps.KmlLayer('http://freezoo.alwaysdata.net/justcrosshair2.kml',
{preserveViewport: true});
crosshairLayer.setMap(map);
google.maps.event.trigger(map, 'resize');
map.setZoom(map.getZoom());
}
</script>
</head>
<body>
<div data-role="page" data-theme="e" data-add-back-btn="true" class="map1" id="testing">
<div data-role="header"><h1>Map Page</h1></div>
<div id="content" style="position:absolute; bottom:40px; top:40px; left:0px; right:0px; background:green;">
<div id="map_canvas" style="position:absolute; top:0px; bottom:0px; width:100%; background:red;"></div>
</div>
<div data-role="footer" style="position:absolute; bottom:0px; width:100%;">
<h1>Working!</h1>
</div>
</div>
</body>
</html>
Lolllllllllllllll – New2This