Google지도에서 마커를 배치하는 방법에 대한 질문이 있습니다. 이 스크립트는 페이지로드 렌더 맵에서 그러나이 맵에 회사 로고를 넣고 싶습니다. 나는 방향이없는 초기지도를 원한다.마커 아이콘 길 찾기 google지도
src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false"></script><script type="text/javascript">// <![CDATA[
var map;
var directionsDisplay;
var manila = new google.maps.LatLng(55.009657,-1.450706);
var directionsService = new google.maps.DirectionsService();
function initialize() {
// Make the route draggable
var rendererOptions = {
draggable: true,
}
directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);
var mapOptions = {
zoom:13,
mapTypeId: google.maps.MapTypeId.DRIVING,
center: manila,
}
map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("directionsPanel"));
}
내가 알고 당신이 마커 객체를 생성 할 필요가지도에 아이콘이하기 위해 ...
var marker=new google.maps.Marker({
position:manila,
icon:'image-link'
});
하고 매핑 설정이 마커 사용하기에 :
marker.setMap(map);
을 하지만 지도에 개체를 전달할 수있는 marker.setMap(map);
대신 directionsDisplay.setMap(map);
을 사용하고 있습니까?
미안 해요, 난 이해가 안 돼요. 왜 둘 다 부를 수 없습니까? 하나는 아이콘을 추가하고 하나는 길 찾기를 표시합니다 – Mawg