久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='bGoMv'></bdo><ul id='bGoMv'></ul>

        <tfoot id='bGoMv'></tfoot>
      1. <i id='bGoMv'><tr id='bGoMv'><dt id='bGoMv'><q id='bGoMv'><span id='bGoMv'><b id='bGoMv'><form id='bGoMv'><ins id='bGoMv'></ins><ul id='bGoMv'></ul><sub id='bGoMv'></sub></form><legend id='bGoMv'></legend><bdo id='bGoMv'><pre id='bGoMv'><center id='bGoMv'></center></pre></bdo></b><th id='bGoMv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bGoMv'><tfoot id='bGoMv'></tfoot><dl id='bGoMv'><fieldset id='bGoMv'></fieldset></dl></div>
      2. <small id='bGoMv'></small><noframes id='bGoMv'>

      3. <legend id='bGoMv'><style id='bGoMv'><dir id='bGoMv'><q id='bGoMv'></q></dir></style></legend>

        在 Leaflet 彈出窗口中添加按鈕

        Adding buttons inside Leaflet popup(在 Leaflet 彈出窗口中添加按鈕)
          <tfoot id='WZoX6'></tfoot>

            <small id='WZoX6'></small><noframes id='WZoX6'>

            <i id='WZoX6'><tr id='WZoX6'><dt id='WZoX6'><q id='WZoX6'><span id='WZoX6'><b id='WZoX6'><form id='WZoX6'><ins id='WZoX6'></ins><ul id='WZoX6'></ul><sub id='WZoX6'></sub></form><legend id='WZoX6'></legend><bdo id='WZoX6'><pre id='WZoX6'><center id='WZoX6'></center></pre></bdo></b><th id='WZoX6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WZoX6'><tfoot id='WZoX6'></tfoot><dl id='WZoX6'><fieldset id='WZoX6'></fieldset></dl></div>

              <tbody id='WZoX6'></tbody>
              <bdo id='WZoX6'></bdo><ul id='WZoX6'></ul>

                  <legend id='WZoX6'><style id='WZoX6'><dir id='WZoX6'><q id='WZoX6'></q></dir></style></legend>

                  本文介紹了在 Leaflet 彈出窗口中添加按鈕的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  當我嘗試在 Leaflet 彈出窗口中添加按鈕時遇到問題.單擊地圖時會生成彈出窗口.

                  I got a problem when I try to add buttons inside a Leaflet popup. The popup is generated when you click on the map.

                  理想情況下,我想彈出 2 個按鈕:

                  Ideally I want to popuo to show 2 buttons:

                  • 從這里開始
                  • 然后去這個位置

                  這個草圖是我想要的結果的一個例子:

                  This sketch is an example of the result I want:

                   ________________________________________________
                  |You clicked the map at LatLng(XXXXX,XXXXX)      |
                  |  ---------------    -------------------        |
                  | |Start from here|  |Go to this location|       |
                  |  ---------------    -------------------        |
                  |___________________  ___________________________|
                                     /
                  

                  這是我在彈出窗口中看到的內容:您在 LatLng(XXXXX,XXXX) [object HTMLButtonElement] 處單擊了地圖

                  this is what I get inside my popUp : You clicked the map at LatLng(XXXXX,XXXX) [object HTMLButtonElement]

                  我正在嘗試使用 L.domUtil 創建按鈕

                  I am trying to create the buttons using L.domUtil

                  defineYourWaypointOnClick(e: any) {
                  
                  var choicePopUp = L.popup();
                  var container = L.DomUtil.create('div'),
                    startBtn = this.createButton('Start from this location', container),
                    destBtn = this.createButton('Go to this location', container);
                  
                  choicePopUp
                    .setLatLng(e.latlng)
                    .setContent('You clicked the map at ' + e.latlng.toString() + '<br>' + startBtn)
                    .openOn(this.map);
                  
                  L.DomEvent.on(startBtn, 'click', () => {
                    alert("toto");
                  });
                  
                  L.DomEvent.on(destBtn, 'click', () => {
                    alert("tata");
                  });
                  }
                  
                  createButton(label: string, container: any) {
                      var btn = L.DomUtil.create('button', '', container);
                      btn.setAttribute('type', 'button');
                      btn.innerHTML = label;
                      return btn;
                  }
                  

                  我從這里調用我的方法:

                  I call my method from here :

                  this.map.on('click', (e: any) => {
                    this.defineYourWaypointOnClick(e);
                  });
                  

                  提前感謝您能給我的任何幫助:)

                  Thank you in advance for any help you can give me :)

                  推薦答案

                  您應該使用 innerHTML 向您的傳單添加按鈕,如下所示

                  You should be using innerHTML to add buttons to your leaflet as below

                  defineYourWaypointOnClick(e: any) {
                  
                  var choicePopUp = L.popup();
                  var container = L.DomUtil.create('div');
                  //////////////////////////////////////////////////////////////////////////////////////////////
                  ///////////modified here
                  startBtn = this.createButton('Start from this location', container),
                  destBtn = this.createButton('Go to this location', container);
                  div.innerHTML = ''+startBtn+ '&nbsp;&nbsp;&nbsp;&nbsp;' + destBtn ; 
                  //////////////////////////////////////////////////////////////////////////////////////////////
                  
                  choicePopUp
                    .setLatLng(e.latlng)
                    .setContent('You clicked the map at ' + e.latlng.toString() + '<br>' + startBtn)
                    .openOn(this.map);
                  
                  L.DomEvent.on(startBtn, 'click', () => {
                    alert("toto");
                  });
                  
                  L.DomEvent.on(destBtn, 'click', () => {
                    alert("tata");
                  });
                  }
                  
                  createButton(label: string, container: any) {
                  var btn = L.DomUtil.create('button', '', container);
                  btn.setAttribute('type', 'button');
                  btn.innerHTML = label;
                  return btn;
                  }
                  

                  這篇關于在 Leaflet 彈出窗口中添加按鈕的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標記群集圖標顏色,繼承其余默認 CSS 屬性)
                  Trigger click on leaflet marker(觸發點擊傳單標記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認加載磁貼顏色?)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                  Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在彈出窗口中獲取標記的緯度和經度)

                  <small id='vWHcd'></small><noframes id='vWHcd'>

                  <i id='vWHcd'><tr id='vWHcd'><dt id='vWHcd'><q id='vWHcd'><span id='vWHcd'><b id='vWHcd'><form id='vWHcd'><ins id='vWHcd'></ins><ul id='vWHcd'></ul><sub id='vWHcd'></sub></form><legend id='vWHcd'></legend><bdo id='vWHcd'><pre id='vWHcd'><center id='vWHcd'></center></pre></bdo></b><th id='vWHcd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vWHcd'><tfoot id='vWHcd'></tfoot><dl id='vWHcd'><fieldset id='vWHcd'></fieldset></dl></div>

                        <tbody id='vWHcd'></tbody>

                          <bdo id='vWHcd'></bdo><ul id='vWHcd'></ul>
                          <tfoot id='vWHcd'></tfoot>
                          <legend id='vWHcd'><style id='vWHcd'><dir id='vWHcd'><q id='vWHcd'></q></dir></style></legend>
                          1. 主站蜘蛛池模板: 亚洲精品一区二区三区蜜桃久 | 中文字幕日韩欧美一区二区三区 | 亚洲国产成人精品女人久久久 | 91色视频在线观看 | 国产一区免费视频 | 99re在线播放 | 日韩二三区 | 日本成人在线免费视频 | 免费在线观看av | 中文字幕第十一页 | 免费观看国产视频在线 | 91久久久久久久久久久久久 | 国产精品成人一区二区三区 | 中文字幕高清av | 天堂亚洲 | 99tv| 欧美性区 | 成人免费淫片aa视频免费 | 亚洲精品欧美一区二区三区 | 狠狠狠色丁香婷婷综合久久五月 | 国产精品久久久久久久久 | 国产传媒视频在线观看 | 99re视频在线免费观看 | 午夜男人天堂 | 久久99精品国产麻豆婷婷 | 亚洲天堂久久 | 欧美11一13sex性hd| 亚洲欧美一区二区三区国产精品 | 亚洲人成人一区二区在线观看 | 精品久久久精品 | 少妇性l交大片免费一 | 狠狠天天| 精品国产一级 | 91伦理片 | 成人片免费看 | 亚洲精品久久久一区二区三区 | 91精品久久久久久久久久 | 欧美一级做a爰片免费视频 国产美女特级嫩嫩嫩bbb片 | 日韩综合在线 | 国产免费一区二区三区 | 成人网av |