jQTouch에서지도 (API 3)를 표시하는 데 문제가 있습니다. 브라우저에서 처음로드 될 때지도의 일부만 표시되지만 창 크기를 조정하면 괜찮습니다. google.maps.event.trigger(map_canvas, 'resize');
함수를 사용하려고하는데 올바른 위치에 넣을 것이라고 생각하지 않거나 코드에 다른 문제가 있습니까? 모든 도움을 많이 주시면 감사하겠습니다.Google지도 API 3 및 jQTouch
<div id="locations">
<div class="toolbar">
<h1>Locations</h1>
<a class="back" href="#">Home</a>
</div>
<div id="map_canvas" style="width:100%;height:240px"></div>
<script type="text/javascript">
function initialize() {
var myOptions = {
zoom: 11,
center: new google.maps.LatLng(50.451820688650656, -4.2572021484375),
mapTypeId: google.maps.MapTypeId.ROADMAP,
panControl: false,
zoomControl: false,
mapTypeControl: false,
scaleControl: false,
streetViewControl: false
}
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
setMarkers(map, localities);
}
var localities = [
['Devonport', 50.370095229957016, -4.169440269470215, 3],
['John Bull Building', 50.41588787780982, -4.1097986698150635, 2],
['Portland Square', 50.375110980041484, -4.138498306274414, 1]
];
function setMarkers(map, locations) {
var image = new google.maps.MarkerImage('http://code.google.com/apis/maps/documentation/javascript/examples/images/beachflag.png',
new google.maps.Size(20, 32),
new google.maps.Point(0,0),
new google.maps.Point(0, 32));
var shadow = new google.maps.MarkerImage('http://code.google.com/apis/maps/documentation/javascript/examples/images/beachflag_shadow.png',
new google.maps.Size(37, 32),
new google.maps.Point(0,0),
new google.maps.Point(0, 32));
var shape = {
coord: [1, 1, 1, 20, 18, 20, 18 , 1],
type: 'poly'
};
for (var i = 0; i < locations.length; i++) {
var location = locations[i];
var myLatLng = new google.maps.LatLng(location[1],location[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
shadow: shadow,
icon: image,
shape: shape,
title: location[0],
zIndex: location[3]
});
}
}
</script>
<?php
include('includes/bottom-nav.php');
?>
</div>
동일한 문제가 있습니다. 아직 해결 방법이 있습니까? – Jakob