2
그래서 전단지가 있습니다. 그것은 잘 동작했지만 어떻게 든 더 이상 작동하지 않습니다! 내 JS 코드에 오류가 있으면 누구나 말해 줄 수 있습니까? 하나를 찾을 수 없습니다.전단지지도가 회색으로 만 표시되지 않습니다.
var map = L.map('map').setView([50.93985, 6.94013], 13);
L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
maxZoom: 13,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'examples.map-i86knfo3'
}).addTo(map);
L.marker([52.26887, 10.52677]).addTo(map)
.bindPopup("<b>Design and Data GmbH</b><br/>XY</b><br/>Braunschweig").openPopup();
L.marker([41.87239, 12.48018]).addTo(map)
.bindPopup("<b>Design and Data GmbH</b><br/>XY</b><br/>Rom").openPopup();
L.marker([50.93985, 6.94013]).addTo(map)
.bindPopup("<b>Design and Data GmbH</b><br/>Hohenzollernring 56</b><br/>51109 Köln").openPopup();
map.fitBounds([
[50.93985, 6.94013],
[52.26887, 10.52677],
[41.87239, 12.48018]
]);
var popup = L.popup();
function onMapClick(e) {
popup
.setLatLng(e.latlng)
.setContent("You clicked the map at " + e.latlng.toString())
.openOn(map);
}
map.on('click', onMapClick);
나는 그것을 살펴보고 사용했던 코드와 비교했습니다. - 죄송합니다. 코드에 문제가 없습니다. 행운을 빕니다. – David
개발자 도구를 열 때 콘솔에 오류가 있습니까? –
@MarkoLetic 아니요, 오류가 없습니다. – lena