태그 : HybridApplication
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Yahoo.kr map</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="minimum-scale=1.0, height=device-height, width=device-width, maximum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://kr.open.gugi.yahoo.com/Client/AjaxMap.php?v=3.7&appid=[]"></script>
<script type="text/javascript" src="gap.js"></script>
<style type="text/css">
#map{
height: 430px;
width: 100%;
}
</style>
<script type="text/javascript">
<!--
var map;
function StartYMap()
{
// 지도 오브젝트를 생성 합니다.
map = new YMap(document.getElementById('map'));
// 지도 확대/축소 콘트롤을 추가합니다.
//map.addZoomLong();
// 지도보기 유형을 선택합니다.
// YAHOO_MAP_SAT: 위성지도
// YAHOO_MAP_HYB: 하이브리드 지도
// YAHOO_MAP_REG: 일반지도
map.setMapType(YAHOO_MAP_REG);
// WGS84 좌표계의 경위도 좌표 오브젝트를 전달하여 위치를 지정
// var center_point = new YGeoPoint(37.37160610616,127.10718565157);
// map.drawZoomAndCenter(center_point,3);
var center_point = new YGeoPoint(37.511411132213,127.05925359288);
map.drawZoomAndCenter(center_point,2);
init();
}
window.onload = StartYMap;
// 初期化
function init() {
var objMap = document.getElementById("map");
objMap.addEventListener("touchstart", touchHandlerStart, true);
objMap.addEventListener("touchmove", touchHandler, true);
objMap.addEventListener("touchend", touchHandlerEnd, true);
}
var startX, startY;
function touchHandlerStart(event) {
startX = event.touches[0].pageX;
startY = event.touches[0].pageY;
event.preventDefault();
}
function touchHandlerEnd(event) {
event.preventDefault();
}
function touchHandler(event) {
// タッチ数を取得 event.touches.length
// タッチ位置を取得
if(event.touches.length == 1) {
// CHENG님이 버그를 수정해 주셨습니다. 2009.05.15
var deltaX = event.touches[0].pageX - startX;
var deltaX = startX - event.touches[0].pageX;
var deltaY = event.touches[0].pageY - startY;
var deltaY = startY - event.touches[0].pageY;
var centerLatLon = map.getCenterLatLon();
var centerXY = map.convertLatLonXY(centerLatLon);
centerXY.x += deltaX;
centerXY.y += deltaY;
var newCenterLatLon = map.convertXYLatLon(centerXY);
//map.drawZoomAndCenter(newCenterLatLon,2);
map.panToLatLon(newCenterLatLon);
startX = event.touches[0].pageX;
startY = event.touches[0].pageY;
}
event.preventDefault();
}
//-->
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
NSString * htmlFileName;
NSString * urlFileName;
htmlFileName = @"index";
urlFileName = @"url";
NSString * urlPathString;
NSBundle * thisBundle = [NSBundle bundleForClass:[self class]];
if (urlPathString = [thisBundle pathForResource:htmlFileName ofType:@"html"]) {
[webView loadRequest:[NSURLRequest
requestWithURL:[NSURL fileURLWithPath:urlPathString]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:20.0]];
}
[window makeKeyAndVisible];

# by | 2008/12/23 07:10 | iPhone | 트랙백 | 덧글(4)
◀ 이전 페이지 다음 페이지 ▶