ポップアップをカスタマイズする別の方法は次のようにポップアップ表示するためのカスタムCSSクラスを作成することである:
<style>
/* css to customize Leaflet default styles */
.popupCustom .leaflet-popup-tip,
.popupCustom .leaflet-popup-content-wrapper {
background: #e0e0e0;
color: #234c5e;
}
</style>
、その後、あなたの中にあなたがbindPopup
方法でマーカーカスタムポップアップを設定して渡すことができdiv
をマッピングあなたが言及customOptionsオブジェクトはcss class name
:
// create popup contents
var customPopup = "<b>My office</b><br/><img src='http://netdna.webdesignerdepot.com/uploads/2014/05/workspace_06_previo.jpg' alt='maptime logo gif' width='150px'/>";
// specify popup options
var customOptions =
{
'maxWidth': '400',
'width': '200',
'className' : 'popupCustom'
}
var marker = L.marker([lat, lng], {icon: myIcon}).addTo(map);
// bind the custom popup
marker.bindPopup(customPopup,customOptions);
はそれを願っています助けてください。
私は公式/構造化された方法の後、Googleマップ上でポップアップを拡張する方法と似たようなものでした。とにかくありがとう – ArthurGuy
その機能を変更したいですか?私は私の答えを更新しました。 –