나의 즐겨찾기 | 블로그홈 | 바로가기 바로가기 | 로그인
거기 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> 

-= IMAGE 1 =-

안녕하세요?

이전에도 한번 물어봤었는데 혹시 지도가 영문으로 가능한지요?
지도 메쉬업을 이용해 외국인을 대상으로 한국 홍보사이트를 만들려고 하는데,
지도가 한국어로만 되어 있어서 애로사항이 있습니다.

혹시, 첨부한 지도의 줌레벨까지만이라고 영문지명이 포함된 지도를 제공해 주시면 안되나요?
북한 지역을 보면 한글,영문으로 지명이 같이 표기되어 있어서 외국인이 보기도 좋을 듯 한데요.
영문지명도 지원된다면 야후맵이 더 많이 사용될 것 같은데요.

그럼 답변 부탁합니다.

지도의 최소사이즈가 얼마인가요?

2008.08.14 14:07 | 물어보세요!! | 흙과나무

http://kr.blog.yahoo.com/gugi_openapi/56 주소복사

지도의 사이즈를 줄이려고 하는데 IE에서 스크립트 에러가 납니다.
그런데 400*400 으로 하면 에러가 안나네요~


<style type="text/css">#map{height: 110px;width: 225px;}</style>


<script type="text/javascript  ">
<!--
var map;
function StartYMap()

{    // 지도 오브젝트를 생성 합니다.
map = new YMap(document.getElementById('map'));
// 지도 확대/축소 콘트롤을 추가합니다.
map.addZoomShort();
// 지도 이동 콘트롤을 추가합니다.
map.removeZoomScale();
// 지도보기 유형을 선택합니다.
map.drawZoomAndCenter(encodeURIComponent("서울 종로구 종로6가 "),3);

var newMarker= new YMarker(encodeURIComponent("서울 종로구 종로6가 "));
map.addOverlay(newMarker);


// 지도 크기 설정
map.resizeTo(new YSize(225,110));



}
window.onload = StartYMap;
//--></script>






파이어폭스에서는 에러없이 잘 동작합니다.
제가 잘못 한건가요?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
 <meta http-equiv="content-type" content="text/html; charset=euc-kr" />
 <title>XML로부터 객체 생성</title>
 
 
 <script type="text/javascript ">
 var ajax = {};
 ajax.xhr = {};

 ajax.xhr.Request = function(url, params, callback, method) {
  this.url = url;
  this.params = params;
  this.callback = callback;
  this.method = method;
  this.send();
 }

 ajax.xhr.Request.prototype = {
  getXMLHttpRequest: function() {
  if (window.ActiveXObject) {
   try {
    return new ActiveXObject("Msxml2.XMLHTTP");
   } catch(e) {
    try {
     return new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e1) { return null; }
   }
  } else if (window.XMLHttpRequest) {
   return new XMLHttpRequest();
  } else {
   return null;
  }  
 },
 send: function() {
  this.req = this.getXMLHttpRequest();
  
  var httpMethod = this.method ? this.method : 'GET';
  if (httpMethod != 'GET' && httpMethod != 'POST') {
   httpMethod = 'GET';
  }
  var httpParams = (this.params == null || this.params == '') ? null : this.params;
  var httpUrl = this.url;
  if (httpMethod == 'GET' && httpParams != null) {
   httpUrl = httpUrl + "?" + httpParams;
  }
  this.req.open(httpMethod, httpUrl, true);
  this.req.setRequestHeader(
   'Content-Type', 'application/x-www-form-urlencoded');
  var request = this;
  this.req.onreadystatechange = function() {
   request.onStateChange.call(request);
  }
  this.req.send(httpMethod == 'POST' ? httpParams : null);
 },
 onStateChange: function() {
  this.callback(this.req);
 }
}
 
 
 window.onload = function() {
  new ajax.xhr.Request("http://kr.open.gugi.yahoo.com/service/rgc.php", "appid=VyY1f0DV34G8HA3UnPbygP8VofLY38zM57lJ7wC7HS3qyxGTBiqrfKa7Qqpetfw&latitude=37.4997677193116&longitude=129.0294189453125&output=xml", viewInfo, "GET");
 }
 function viewInfo(req) {
  if (req.readyState == 4) {
   if (req.status == 200) {
    var docXML = req.responseXML;
    var code = docXML.getElementsByTagName("Found")
                     .item(0).firstChild.nodeVal ue;
    if (code == '1') {
     var country = docXML.getElementsByTagName("country")
          .item(0).firstChild.nodeVal ue;
     var state = docXML.getElementsByTagName("state")
                      .item(0).firstChild.nodeVal ue;
     var county = docXML.getElementsByTagName("county")
                      .item(0).firstChild.nodeVal ue;
     var town = docXML.getElementsByTagName("town")
                      .item(0).firstChild.nodeVal ue;

     
     alert(country+state+county+town);
    } else {
     alert("실패");
    }
   } else {
    alert("에러 발생:"+req.status);
   }
  }
 }
 </script>
</head>
<body>
</body>
</html>

브라우져에서xml로 결과가나오는데 이것을 돔을사용해서 접근해서 정보를 가져오려고 하는데 잘안되네요
브라우져실행하면 접근권한이없다고 나오는데 
잘알려주세요

results query string이 전달되는지요?

2008.08.10 19:34 | 물어보세요!! | suritam9

http://kr.blog.yahoo.com/gugi_openapi/54 주소복사

results에 50이나 100을 입력해도, 기본적으로 20개 밖에 결과나 안 나옵니다.
된다면, sample url 하나만, 적어 주세요.

이전 페이지 [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 ] 다음 페이지
 
거기오픈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=&..
<a href=&..
최근 참조글 전체보기
Xanax.
Cilias.
Soma.
Xanax.
Soma.
 즐겨찾기
 즐겨찾기 글모음
개설일 : 2007/12/10