ondrilldown (events)

맵 영역을 클릭한 시점에 드릴다운 처리를 위해 발생하는 이벤트입니다.
드릴다운 처리는 onclick 이벤트에서 처리하는 것 보다 ondrilldown 이벤트에서 처리하는 게 좋습니다.

Syntax

IBMapCharts.create(
    {
        map : {
            ondrilldown : function(ev){
                
            }
        }
    }
)

Parameters

Name Type Description
id string 대상 맵 영역의 id
mapData object 대상 맵 영역의 geojson 데이터 객체
data object 대상 맵 영역의 데이터 객체
event object dom 이벤트 객체
index number 드릴다운 index
drilldown function 드릴다운 처리를 위한 함수

Returns

boolean

Example

var cfg = {
    map : {
        ondrilldown: function(ev) {
            // 드릴다운 인덱스가 0 이면 드릴다운 처리
            if (ev.index === 0) {
                ev.drilldown({
                    url: "./map/json/kr/" + ev.id + ".json"
                });
            }
        }
    }
}

IBMapCharts.create({
    elem : "container",
    cfg : cfg
});