久久久久久久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 - 點(diǎn)擊時(shí)設(shè)置標(biāo)記,拖動(dòng)時(shí)更新位置

        leaflet.js - Set marker on click, update position on drag(Leaflet.js - 點(diǎn)擊時(shí)設(shè)置標(biāo)記,拖動(dòng)時(shí)更新位置)

            <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 - 點(diǎn)擊時(shí)設(shè)置標(biāo)記,拖動(dòng)時(shí)更新位置的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  對(duì)于我正在處理的一個(gè)小項(xiàng)目,我需要能夠在 Leaflet.js 驅(qū)動(dòng)的圖像地圖上放置一個(gè)標(biāo)記,并在它被拖動(dòng)時(shí)更新該標(biāo)記的位置.我使用下面的代碼來(lái)嘗試這個(gè),但它失敗了.我收到錯(cuò)誤未定義標(biāo)記".我不知道為什么它不起作用 - 也許你們可以幫助我?;)

                  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();
                  });
                  

                  推薦答案

                  在上面的代碼片段中,在添加事件處理程序時(shí)沒(méi)有定義標(biāo)記.在創(chuàng)建標(biāo)記后立即添加 dragend 偵聽(tīng)器,請(qǐng)嘗試以下操作:

                  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() 行末尾還缺少一個(gè)括號(hào).

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

                  您還在 setLatLng 調(diào)用中將 position 放入了一個(gè)數(shù)組中,但它已經(jīng)是一個(gè) LatLng 對(duì)象.

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

                  這篇關(guān)于Leaflet.js - 點(diǎn)擊時(shí)設(shè)置標(biāo)記,拖動(dòng)時(shí)更新位置的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                  <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. 主站蜘蛛池模板: 国产亚洲精品久久久优势 | 狠狠爱综合网 | 精品乱码一区二区三四区视频 | 波多野结衣精品 | 国产精品免费一区二区 | 国产成人网 | 中文字幕亚洲欧美 | 久久久久久久久久久爱 | 99pao成人国产永久免费视频 | 成人欧美一区二区 | 亚洲一区 | 亚洲精品乱码 | 99亚洲精品视频 | 久草网址 | 天天操天天干天天曰 | 欧美乱大交xxxxx另类电影 | 日本一道本 | 国产99精品 | 91亚洲国产成人久久精品网站 | 99色综合| 蜜桃视频在线观看免费视频网站www | 狠狠干综合视频 | 国产精品精品视频一区二区三区 | 亚洲精品欧美一区二区三区 | 午夜亚洲| 日韩在线xx | 国产欧美一区二区三区在线看 | 久久免费看 | 91国产精品在线 | 久久1区 | 日韩视频a| 色综合99| 91精品国产高清久久久久久久久 | 亚洲九九| 九九热这里 | 粉嫩高清一区二区三区 | 国产精品精品视频一区二区三区 | 羞羞视频在线观看免费观看 | 天堂久久av | www.一区二区三区.com | 久久国际精品 |