久久久久久久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í)更新位置的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  對于我正在處理的一個(gè)小項(xiàng)目,我需要能夠在 Leaflet.js 驅(qū)動(dòng)的圖像地圖上放置一個(gè)標(biāo)記,并在它被拖動(dòng)時(shí)更新該標(biāo)記的位置.我使用下面的代碼來嘗試這個(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í)沒有定義標(biāo)記.在創(chuàng)建標(biāo)記后立即添加 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() 行末尾還缺少一個(gè)括號.

                  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 對象.

                  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í)更新位置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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. 主站蜘蛛池模板: 免费中文字幕日韩欧美 | www.日本国产| 亚洲一区在线播放 | 在线欧美一区 | 亚洲最新在线视频 | 国产精品视频97 | 亚洲一区成人 | 久久久久亚洲 | 日韩欧美一区二区三区 | 欧美一级在线 | 人人玩人人添人人澡欧美 | 亚洲毛片在线观看 | 久久久久久毛片免费观看 | 精品一区二区三区四区五区 | 99只有精品 | www国产亚洲精品 | 成人二区 | 日日摸天天添天天添破 | 精品日韩一区 | 日韩中文字幕在线播放 | 黄色大全免费看 | 网黄在线 | 欧美电影一区 | 国产一区久久久 | 一区二区高清 | 国产欧美精品一区二区 | 性欧美精品一区二区三区在线播放 | 亚洲免费视频一区二区 | 亚洲综合色网 | 麻豆国产一区二区三区四区 | 91亚洲精 | 日韩中文字幕一区 | 日韩快播电影网 | 成人h视频在线 | 中文字幕在线看第二 | 欧美美女被c | 欧美黄色片在线观看 | 热re99久久精品国产99热 | 日韩精品一区二区三区 | 日韩一区在线播放 | 国产丝袜一区二区三区免费视频 |