|
|
|
|
|
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>
|
http://kr.blog.yahoo.com/gugi_openapi/trackback/12/63
-
거기오픈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
-
해결했습니다 감사합니다^^
답글쓰기
-
|
|
|
|
|