我是初級 Web 開發人員,我在使用 Open Street Map 時遇到問題:https : //ibb.co/x8mqR62我有這個代碼:<div id="mapdiv"></div> <script type="text/javascript"> function onLocationFound(e) { var radius = e.accuracy / 2; lat = e.latlng.lat; lng = e.latlng.lng; L.marker(e.latlng).addTo(map).bindPopup("Tutaj jeste?!!!"); //L.circle(e.latlng, radius).addTo(map); map.setView([lat, lng], 12); } function onLocationError(e) { //alert(e.message); console.log(e.message); } var map = L.map('mapdiv', { editable: true, fadeAnimation: false }).setView([54.35070881441067, 18.641191756395074], 12); L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', { // L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors', maxZoom: 18, zoomControl: true, detectRetina: true }).addTo(map); let myFilter = ['grayscale:100%']; let myTileLayer = L.tileLayer.colorFilter('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png', { attribution: '<a href="https://wikimediafoundation.org/wiki/Maps_Terms_of_Use">Wikimedia</a>', filter: myFilter, }).addTo(map); // lc = L.control.locate({ // strings: { // title: "Poka? gdzie jestem" // } // }).addTo(map); var LeafIcon = L.Icon.extend({ options: { iconSize: [25, 29], iconAnchor: [25, 29], popupAnchor: [-12, -22] } });這個地圖工作正常,但我的問題是灰色背景。我的地圖在線預覽:http : //serwer1356363.home.pl/pub/test/mapa.html如何刪除灰色背景并顯示正常的彩色地圖?
地圖下背景錯誤(地圖背景有問題)
米琪卡哇伊
2021-06-28 17:00:53