0
gmap3에 문제가 있습니다. 마커에 정보를 추가하고 정보 창에 정보를 표시하고 싶습니다. 그러나 기본 마커는 "제목", "데이터"및 일부 옵션과 같은 일부 변수 만 포함하므로이 정보를 마커에 추가하는 방법을 모르겠습니다.Gmap3 마커에 몇 가지 새로운 변수를 추가하고 마우스 이벤트가 발생하면 검색하는 방법은 무엇입니까?
이제 주소와 같은 정보를 추가하고 싶습니다. 마커에 이벤트를 저장하고 마우스 이벤트가 발생하면 어떻게 가져 옵니까?
$('#gmap').gmap3({
map:{
options:{
center:[10.823099,106.629664],
zoom: 15
}
},
marker:{
values:Markers,
options:{
draggable: false
},
events:{
click: function(marker,event,context){
},
mouseover: function(marker, event, context){
var map = $(this).gmap3("get"),
infowindow = $(this).gmap3({get:{name:"infowindow"}});
if (infowindow){
infowindow.open(map, marker);
infowindow.setContent('<div class="infoWindow">'+context.data+'</div>');
} else {
$(this).gmap3({
infowindow:{
anchor:marker,
options:{content: context.data}
}
});
}
},
mouseout: function(){
var infowindow = $(this).gmap3({get:{name:"infowindow"}});
if (infowindow){
infowindow.close();
}
}
}
}
});
여기 내 초기화 기능입니다.
는 그리고 이것은 내 마커입니다 :
marker = {
latLng : [location.Latitude, location.Longitude],
data : '<span class="title"><b>'+location.Title+'</b></span>'+'<br>'+'<span class="address">'+location.Address+'</span>',
options:{icon: 'data:image/png;base64,'+location.LocationType.Image},
locationData: location
};
Markers.push(marker);
그래서 메인 질문 : 어떻게 locationData 때 클릭 이벤트 화재를 검색 할 수 있습니까?
미리 감사드립니다.