나의 즐겨찾기 | 블로그홈 | 바로가기 바로가기 | 로그인
거기 Open API 공식 블로그를 방문해 주셔서 감사합니다.
블로그  |  사진갤러리  |  동영상갤러리 방명록  |   즐겨찾기 추가

request객체에 Lat랑 Lon 값을 저장한후에 저 지점으로 이동하고싶은데
잘안되네요
map.drawZoomAndCenter("Seongju", 11);
lpoint=new YGeoPoint(lat,lon)
map.panToLatLon(lpoint)

이런식으로 쓰면 자꾸
340번째 줄에 Lon이 null이라고 에러가 납니다
소스보기를 했을경우에는 340줄도 없구요

전체소스

<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<% request.setCharacterEncoding("EUC-KR"); %>
<%@ page import="info.location.*" %>
<%Searchkey key=(Searchkey)request.getAttribute("key");
System.out.println(key.getInfo_Lon());
%>

<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
 <title>지역 이름 가져오기</title>
 <script type="text/javascript " src="<%= request.getContextPath() %>/map/mapMake.js"></script>
 <script type="text/javascript " src="<%= request.getContextPath() %>/map/ajax.js"></script>
 <script type="text/javascript " src="<%= request.getContextPath() %>/info/map/findWhere.js"></script>
 <script type="text/javascript ">
 
  function locationName(){
   var map = new YMap(document.getElementById('map'));
   // map.addTypeControl();
   map.addZoomLong();
   // map.addPanControl();

   var lpoint= new YGeoPoint(<%=key.getInfo_Lat()%>,<%=key.getInfo_Lon()%>); 
   map.drawZoomAndCenter("Seongju", 11);
   map.panToLatLon(lpoint,100);
   YEvent.Capture(map, EventsList.MouseDoubleClick, getLocationName);
   // map.disablePanOnDoubleClick();
  }
  function getLocationName(_e, _c){
   var params = "latitude=" + _c.Lat + "&longitude=" + _c.Lon;
   new ajax.Request("<%= request.getContextPath() %>/map/getLocation.jsp", params, loadLocationName, "GET");
  
  }
 </script>
 <style type="text/css">
  #map{ height:290px; width:760px; }
 </style>
</head>
<body onl oad="locationName();">
<center>
 <div id="map"></div>
 <form action="<%=request.getContextPath()%>/info/searchlocation.do" method=post name=form>
  <br>State : <input id="state" name="info_state" type="text"></input>
  <br>County : <input id="county" name="info_county" type="text"></input>
  <input type="text" name="info_Lat" />
  <input type="text" name="info_Lon" />
 </form>
</center>
</body>
</html> 

거기오픈API 2008.08.26  09:45

var lpoint= new YGeoPoint(<%=key.getInfo_Lat()%>,<%=key.getInfo_Lon()%>);
이 부분에 값이 들어 있는지 확인해 주세요. 그리고, YGeoPoint에 값이 있다면 구지 map.drawZoomAndCenter("Seongju", 11);와 같이 하지 않고 바로 map.drawZoomAndCenter(lpoint, 11); 하시면 됩니다. 감사합니다.

답글쓰기
hricain9 2008.08.26  10:40

해결했습니다 감사합니다^^

답글쓰기

댓글쓰기

댓글쓰기 입력폼

포스트 목록 닫기

목록보기
 
거기오픈API (gugi_openapi)
프로필     
전체 글보기(57)
알립니다
물어보세요!! 새 댓글이 있습니다.
2009 12월
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
최근 글
블로그 이전합니다~~~..
블로그를 이전합니다....
지도검색
지도 resize 이후..
커스텀오버레이를 삭제하..
HanRSS 로 구독하기Fish 로 구독하기
최근 댓글 전체보기
<a href=&..
<a href=&..
<a href=&..
<a href=&..
감사합니다^^
최근 참조글 전체보기
Xanax.
Cilias.
Soma.
Xanax.
Soma.
 즐겨찾기
 즐겨찾기 글모음
개설일 : 2007/12/10