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

    <bdo id='Hqx3s'></bdo><ul id='Hqx3s'></ul>

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

        <legend id='Hqx3s'><style id='Hqx3s'><dir id='Hqx3s'><q id='Hqx3s'></q></dir></style></legend>
      3. 傳單 panTo(或 setview)功能?

        Leaflet panTo (or setview) function?(傳單 panTo(或 setview)功能?)

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

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

                  本文介紹了傳單 panTo(或 setview)功能?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我想創(chuàng)建一個(gè) panTo 函數(shù).當(dāng)我單擊鏈接時(shí),地圖會(huì)平移到坐標(biāo).但我不確定如何將值傳遞給函數(shù).我開(kāi)始為鏈接提供 Pointfield (pt) 值,如下所示:

                  I want to create a panTo -function. When I click a link the map pans to the coordinates. But im not sure how to pass the value to the function. I'm starting with giving the link the Pointfield (pt) value like this:

                  <a href="#" class="marker" value="{{ mymodel.pt }}">Link</a>
                  

                  然后我一直在嘗試這個(gè):

                  Then I've been trying this:

                  $("#dialog").on("click", ".marker", function(e) {
                      e.preventDefault();
                      map.panTo($(this).attr("value"));
                      });
                  

                  那沒(méi)用.我認(rèn)為這是一個(gè)范圍問(wèn)題,函數(shù)無(wú)法讀取地圖"變量,因?yàn)樗辉诔跏嫉貓D腳本下.

                  That didn't work. I think it's a scope-issue where the function cant read the 'map' variable because it's not under the initial map script.

                  所以我的下一個(gè)想法是創(chuàng)建一個(gè)panTo"- 函數(shù)并將其放在初始地圖腳本(這將是正確的范圍)下,然后從點(diǎn)擊事件中調(diào)用該函數(shù).不確定它會(huì)起作用,但我想知道如何從鏈接中傳遞值"?

                  So my next idea is to create a "panTo"- function and place it under the inital map script (which would be the right scope) and call that function from the click event instead. Not sure it would work but Im wondering how to pass it the "value" from the link?

                  感謝您的回答!

                  推薦答案

                  您可以利用 HTML 中的 data 屬性向地圖添加導(dǎo)航.將緯度、經(jīng)度和縮放保存到類(lèi)似 data-position 的位置,然后在用戶(hù)單擊錨標(biāo)記時(shí)使用一些 JavaScript 調(diào)用這些值.這里有一些代碼來(lái)說(shuō)明.

                  You can add navigation to your map by utilizing data attributes in your HTML. Save the latitude,longitude and zoom to something like data-position and then call those values with some JavaScript when the user clicks on the anchor tag. Here's some code to illustrate.

                  <div id="map">
                      <div id="map-navigation" class="map-navigation">
                          <a href="#" data-zoom="12" data-position="37.7733,-122.4367">
                              San Francisco
                          </a>
                      </div>
                  </div>
                  
                  <script>
                  var map = L.map('map').setView([51.505, -0.09], 13);
                  
                  L.tileLayer('http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', {
                                  maxZoom: 18,
                                  attribution: 'Map data &copy; <a >OpenStreetMap</a> contributors, <a >CC-BY-SA</a>, Imagery ? <a 
                              }).addTo(map);
                  
                  document.getElementById('map-navigation').onclick = function(e) {
                      var pos = e.target.getAttribute('data-position');
                      var zoom = e.target.getAttribute('data-zoom');
                      if (pos && zoom) {
                          var loc = pos.split(',');
                          var z = parseInt(zoom);
                          map.setView(loc, z, {animation: true});
                          return false;
                      }
                  }
                  </script>
                  

                  這篇關(guān)于傳單 panTo(或 setview)功能?的文章就介紹到這了,希望我們推薦的答案對(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='QsRNf'></small><noframes id='QsRNf'>

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

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

                            <tbody id='QsRNf'></tbody>

                          1. 主站蜘蛛池模板: 久久久久久久久久久高潮一区二区 | 女同久久另类99精品国产 | 国产一二三视频在线观看 | 欧美福利久久 | av黄色在线 | 99综合在线 | 91资源在线 | 999久久久 | 久久国内精品 | 久久久久一区二区三区 | 欧美久久一区二区 | 国产99免费视频 | 九九福利 | 色婷婷狠狠 | 伊人亚洲 | 在线免费观看毛片 | 日韩aⅴ视频 | 自拍偷拍3p | 在线国产视频 | 91美女在线 | 成人二区 | 国产目拍亚洲精品99久久精品 | 国产91久久久久久久免费 | 青青草一区二区三区 | 成人免费视频网址 | 我爱操| 亚洲精品高清视频 | 亚洲91精品| 日韩精品在线播放 | 精品久久久久久亚洲综合网 | 综合久久av | 操夜夜| 精品一区精品二区 | 精品www | 在线播放国产视频 | 久久久国产一区二区三区四区小说 | 久久久久国产一级毛片高清网站 | 国产精品久久久久久久一区探花 | 欧美日韩久久 | 日韩伦理电影免费在线观看 | 色偷偷888欧美精品久久久 |