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

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

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

          <bdo id='nuBw3'></bdo><ul id='nuBw3'></ul>
        <tfoot id='nuBw3'></tfoot>
      1. Leaflet.js - 點擊時設置標記,拖動時更新位置

        leaflet.js - Set marker on click, update position on drag(Leaflet.js - 點擊時設置標記,拖動時更新位置)

            <legend id='gaGMy'><style id='gaGMy'><dir id='gaGMy'><q id='gaGMy'></q></dir></style></legend>
              <tbody id='gaGMy'></tbody>

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

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

                • 本文介紹了Leaflet.js - 點擊時設置標記,拖動時更新位置的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  對于我正在處理的一個小項目,我需要能夠在 Leaflet.js 驅動的圖像地圖上放置一個標記,并在它被拖動時更新該標記的位置.我使用下面的代碼來嘗試這個,但它失敗了.我收到錯誤未定義標記".我不知道為什么它不起作用 - 也許你們可以幫助我?;)

                  for a small project I am working on, I need to be able to place a marker on a leaflet.js powered image-map and update the position of this marker, if it gets dragged. I use the following code to try this, but it fails. I get the error 'marker not defined'. I don't know why it's not working - maybe you guys could help me out? ;)

                  function onMapClick(e) {
                      gib_uni();
                      marker = new L.marker(e.latlng, {id:uni, icon:redIcon, draggable:'true'};
                      map.addLayer(marker);
                  };
                  
                  marker.on('dragend', function(event){
                      var marker = event.target;
                      var position = marker.getLatLng();
                      alert(position);
                      marker.setLatLng([position],{id:uni,draggable:'true'}).bindPopup(position).update();
                  });
                  

                  推薦答案

                  在上面的代碼片段中,在添加事件處理程序時沒有定義標記.在創建標記后立即添加 dragend 偵聽器,請嘗試以下操作:

                  In the code snippet above, marker is not defined at the time the event handler is added. Try the following where the dragend listener is added immediately following the creation of the Marker:

                  function onMapClick(e) {
                      gib_uni();
                      marker = new L.marker(e.latlng, {id:uni, icon:redIcon, draggable:'true'});
                      marker.on('dragend', function(event){
                              var marker = event.target;
                              var position = marker.getLatLng();
                              console.log(position);
                              marker.setLatLng(position,{id:uni,draggable:'true'}).bindPopup(position).update();
                      });
                      map.addLayer(marker);
                  };
                  

                  您的新 L.Marker() 行末尾還缺少一個括號.

                  You were also missing a bracket at the end of your new L.Marker() line.

                  您還在 setLatLng 調用中將 position 放入了一個數組中,但它已經是一個 LatLng 對象.

                  You also put position into an array in the call to setLatLng but it is already a LatLng object.

                  這篇關于Leaflet.js - 點擊時設置標記,拖動時更新位置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='5gH73'></small><noframes id='5gH73'>

                • <legend id='5gH73'><style id='5gH73'><dir id='5gH73'><q id='5gH73'></q></dir></style></legend>
                    <bdo id='5gH73'></bdo><ul id='5gH73'></ul>

                      <tfoot id='5gH73'></tfoot>

                      • <i id='5gH73'><tr id='5gH73'><dt id='5gH73'><q id='5gH73'><span id='5gH73'><b id='5gH73'><form id='5gH73'><ins id='5gH73'></ins><ul id='5gH73'></ul><sub id='5gH73'></sub></form><legend id='5gH73'></legend><bdo id='5gH73'><pre id='5gH73'><center id='5gH73'></center></pre></bdo></b><th id='5gH73'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5gH73'><tfoot id='5gH73'></tfoot><dl id='5gH73'><fieldset id='5gH73'></fieldset></dl></div>
                          <tbody id='5gH73'></tbody>
                          1. 主站蜘蛛池模板: 在线看的av| 国精产品99永久一区一区 | 国产一区精品在线观看 | 日本黄色免费看 | 成人免费看片98欧美 | 夜夜草视频 | 四虎色播 | 日日干夜夜操 | 亚洲黄色成人 | 99在线视频免费观看 | 日韩不卡在线观看 | 精品国产乱码一区二区三 | 免费观看一级毛片 | 伊人干综合 | 黄色福利网站 | 亚洲天堂影院 | 人人看av| 黄色片免费观看 | 免费在线 | 中文字幕高清在线 | 草草在线视频 | 久久青草视频 | 五月激情综合网 | 精品视频国产 | 久在线视频| 国产农村妇女aaaaa视频 | 午夜激情在线观看 | 一区二区在线免费观看 | 中文字幕第一区 | 欧美午夜理伦三级在线观看 | 中文在线观看免费视频 | 97精品久久 | 久久激情小说 | 免费国产黄色 | 久久精品亚洲 | 欧美特黄 | 一级片免费播放 | 色婷婷久久综合 | 欧美精品三级 | 综合av| 一级免费黄色片 |