以下の例のように、GMaps.jsを使用してマップにコンテキストメニューを追加することができました。
map.setContextMenu({
control: 'map',
options: [{
title: 'Add marker',
name: 'add_marker',
action: function(e) {
this.addMarker({
lat: e.latLng.lat(),
lng: e.latLng.lng(),
title: 'New marker'
});
}
}, {
title: 'Center here',
name: 'center_here',
action: function(e) {
this.setCenter(e.latLng.lat(), e.latLng.lng());
}
}]
});
ただし、マーカーにコンテキストメニューを追加できないようです。
誰かがこれを行う方法を投稿できますか
ありがとう