我使用 Leaflet markercluster 插件:https ://github.com/Leaflet/Leaflet.markercluster當我將標記的默認坐標更改為其他坐標時,標記會出現錯誤的位置。此問題的示例:https://jsfiddle.net/allu1/nbv17oqc/5/在“geoJsonData”標簽下方,第一個標記坐標已更改,但標記完全位于錯誤的位置。而且我也無法設置地圖的中心點。我已經嘗試了所有這些,但沒有任何效果: var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' });var centermap = L.latLng(64.299791, 27.182384); var map = L.map('map') .setView(centermap, 5).addLayer(tiles);和var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' }), latlng = L.latLng(64.299791, 27.182384); var map = L.map('map', {center: latlng, zoom: 5.5, fullscreenControl: true, }).addLayer(tiles);和var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' }); var map = L.map('map', { center: L.latLng(64.299791, 27.182384), zoom: 4}).addLayer(tiles);我使用過Leaflet全屏插件:https://github.com/Leaflet/Leaflet.fullscreen 并且全屏選項顯示良好,但地圖的中心點不起作用。最主要的是中心點可以工作。如果需要的話,我會提供更多信息。感謝您的回答!
標記顯示在錯誤的位置/無法在傳單中設置中心點
三國紛爭
2023-07-06 11:08:29