コントロールがアクティブ化または非アクティブ化されたときにアクションを実行する場合は、次のベース クラスから onActivate()または onDeactivate()メソッド(またはその両方)を上書きします。
mobileViewer. MyNewControl = OpenLayers.Class(mobileViewer.Control,
{
initializeControl: function(options)
{
},
onActivate: function()
{
alert(‘Hello World’);
},
onDeactivate: function()
{
alert(‘Gone Fishing’);
}
});