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

  • <small id='5FPy7'></small><noframes id='5FPy7'>

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

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

        如何在傳單地圖上突出顯示選定的行?

        how to highlight a chosen line on a leaflet map?(如何在傳單地圖上突出顯示選定的行?)

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

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

                  <tbody id='R8fPX'></tbody>

                  <legend id='R8fPX'><style id='R8fPX'><dir id='R8fPX'><q id='R8fPX'></q></dir></style></legend>
                  本文介紹了如何在傳單地圖上突出顯示選定的行?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想畫一張地圖,上面畫了幾條路線.

                  I want to draw a map with few routes drawn on it.

                  我想要一個帶有數(shù)字 1,..,n 的保管箱

                  I want to have a dropbox with numbers 1,..,n

                  當(dāng)下拉框中的一個項(xiàng)目被選中時,相應(yīng)的路線會在地圖上突出顯示.

                  when an item in the dropbox is chosen, the corresponding route is highlighted on the map.

                  我已經(jīng)開始使用傳單"了.

                  I have started using "leaflet".

                  如何突出顯示一行?我使用了重量",但它更像是一條線的邊界.我想看到這條線越來越粗.

                  how do I highlight a line? I have used "weight" but it's more a border to a line. I would like to see the line is getting bolder.

                  這是我的代碼:

                  document.onload = loadMap();
                  
                  function loadMap() {
                    var map = L.map('map').setView([37.8, -96], 4);
                  
                  
                    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
                      attribution: 'Map data &copy; <a >OpenStreetMap</a> contributors,<a >CC-BY-SA</a>, Imagery ? <a ,
                      maxZoom: 18,
                      id: 'mapbox.streets',
                      accessToken: 'pk.eyJ1IjoiZW======V6ZTdlb2V5cyJ9.3HqHQ4BMRvSPaYe8ToA7YQ'
                    }).addTo(map);
                  
                  
                    var marker = L.marker([51.5, -0.09]).addTo(map);
                  
                  
                    var myLines = [{
                      "type": "LineString",
                      "properties": {
                        "id": "1"
                      }
                      "coordinates": [
                        [-100, 40],
                        [-105, 45],
                        [-110, 55]
                      ]
                    }, {
                      "type": "LineString",
                      "properties": {
                        "id": "2"
                      }
                      "coordinates": [
                        [-105, 40],
                        [-110, 45],
                        [-115, 55]
                      ]
                    }];
                  
                    var myLayer = L.geoJson().addTo(map);
                    myLayer.addData(myLines);
                  
                  
                    geojson = L.geoJson(myLines, {
                      onEachFeature: onEachFeature
                    }).addTo(map);
                  
                  }
                  
                  
                  
                  function highlightFeature(e) {
                    var layer = e.target;
                  
                    layer
                  
                    layer.setStyle({
                      weight: 25,
                      color: '#ff3300',
                      dashArray: '',
                      fillOpacity: 0.7
                    });
                  
                    if (!L.Browser.ie && !L.Browser.opera) {
                      layer.bringToFront();
                    }
                  }
                  
                  function resetHighlight(e) {
                    geojson.resetStyle(e.target);
                  
                  
                    layer.setStyle({
                      weight: 5,
                      color: '#0000ff',
                      dashArray: '',
                      fillOpacity: 0.7
                    });
                  }
                  
                  
                  function onEachFeature(feature, layer) {
                    layer.on({
                      mouseover: highlightFeature,
                      mouseout: resetHighlight,
                      // click: zoomToFeature
                    });
                  }
                  
                  $('select[name="dropdown"]').change(function() {
                  
                    var item = $(this).val();
                    alert("call the do something function on option " + item);
                    //how to make the chosen line highlighted ??
                  
                  });

                  推薦答案

                  weight 屬性不會改變線條邊框,它會改變筆畫寬度(以像素為單位).您會獲得 border 效果,因?yàn)槟砑恿藘纱尉€條.這里:

                  weight property is not changing line border, it changes stroke width in pixels. You get border effect because you are adding lines twice. Here:

                  myLayer.addData(myLines);
                  

                  這里:

                  geojson = L.geoJson(myLines, {
                      onEachFeature: onEachFeature
                    }).addTo(map);
                  

                  當(dāng)懸停多段線時,頂層的樣式會發(fā)生變化,但由于您添加了兩次多段線,因此仍然保留來自下層的多段線.正如 here 所述,默認(rèn)筆畫不透明度為 0.5(設(shè)置 <順便說一句,code>fillOpacity 對于折線來說是多余的,用于更改 stroke-opacity opacity 屬性).頂層的折線變成半透明的,這會產(chǎn)生邊框效果的錯覺.

                  When a polyline is hovered, top layer's style is changed, but because you are adding polylines twice, there still remains a polyline from the lower layer. As it is described here, default stroke opacity is 0.5 (setting fillOpacity is redundant for the polyline by the way, for changing stroke-opacity opacity property is used). Polyline from the top layer becomes semi-transparent, and that makes the illusion of the border effect.

                  因此,您只需刪除這一行 myLayer.addData(myLines); 并獲得預(yù)期的結(jié)果.

                  So, you can just remove this line myLayer.addData(myLines); and get the expected result.

                  我制作了一個 fiddle,您的示例已在其中得到糾正.

                  I've made a fiddle, where your example is corrected.

                  這篇關(guān)于如何在傳單地圖上突出顯示選定的行?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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(檢查一個多邊形點(diǎn)是否在傳單中的另一個內(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)度)
                  <legend id='YM765'><style id='YM765'><dir id='YM765'><q id='YM765'></q></dir></style></legend>

                    <bdo id='YM765'></bdo><ul id='YM765'></ul>
                        <tbody id='YM765'></tbody>
                    • <tfoot id='YM765'></tfoot>

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

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

                          1. 主站蜘蛛池模板: 国产精品乱码一二三区的特点 | 麻豆视频在线看 | 日韩一区二区三区四区五区 | chinese中国真实乱对白 | 亚洲国产一区在线 | 成人妇女免费播放久久久 | 亚洲精品视频观看 | 免费一看一级毛片 | 国产a区| 中国一级特黄真人毛片免费观看 | 精品视频久久久 | 久久久99国产精品免费 | 日韩免费av网站 | 精品1区 | 伊人久麻豆社区 | 国产精品自拍视频 | 亚洲高清视频在线 | 91在线看片 | 亚洲香蕉 | 久久伊人一区二区 | 久久夜色精品国产 | 欧美色性 | 亚洲精品国产精品国自产在线 | 国产午夜精品久久久久免费视高清 | aaa一区| a在线观看 | 精品一区二区久久久久久久网精 | 亚洲一区视频在线 | 人人人艹 | 免费国产一区二区 | 欧美久久久久久 | 欧美日韩综合 | 一区二区播放 | 久久精品小视频 | av网站在线免费观看 | 精品国产黄a∨片高清在线 www.一级片 国产欧美日韩综合精品一区二区 | 国产成人a亚洲精品 | 成人精品一区二区 | 久久久激情视频 | 久草热8精品视频在线观看 午夜伦4480yy私人影院 | 久久国产精品首页 |