我使用 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 并且全屏选项显示良好,但地图的中心点不起作用。最主要的是中心点可以工作。
如果需要的话,我会提供更多信息。感谢您的回答!
饮歌长啸
相关分类