function drawMap(div_id,addr, content) { var lat = 0, lng = 0; content = content.replace("[tmap_href]",PLANET.get_tmap_url(addr)); content = content.replace("[nmap_href]","http://maps.naver.com/?query="+addr); naver.maps.Service.geocode({ address: addr }, function(status, response) { if (status === naver.maps.Service.Status.ERROR) { return alert('Something wrong!'); } // 성공시의 response 처리 lat = response.result.items[0].point.y; lng = response.result.items[0].point.x; var maru = new naver.maps.LatLng(lat, lng), map = new naver.maps.Map(div_id, { center: maru.destinationPoint(0, 200), zoom: 11, mapTypeControl: true, scaleControl: false, logoControl: false, mapDataControl: false, zoomControl: true, minZoom: 1 }), marker = new naver.maps.Marker({ map: map, position: maru }); var contentString = content; var infowindow = new naver.maps.InfoWindow({ content: contentString, backgroundColor: "#fff", borderColor: "#c1c1c1", borderWidth: 1, anchorSize: new naver.maps.Size(30, 30), anchorSkew: true, anchorColor: "#fff", pixelOffset: new naver.maps.Point(0, -20) }); naver.maps.Event.addListener(marker, "click", function(e) { if (infowindow.getMap()) { infowindow.close(); } else { infowindow.open(map, marker); } }); infowindow.open(map, marker); }); }