0
일부 위치 (좌표)에는 여러 점이 존재하며 제목을 툴팁에 결합하고자합니다. 일부는 여러 항목이 존재할 수있는 좌표에서여러 제목이있는지도 박스 표식
다음은 제이빌더 파일을
json.type "FeatureCollection"
json.features @years do |year|
json.type "Feature"
json.properties do
if (year.resto)
json.set! "marker-color", "#9932CC"
json.set! "marker-symbol", "restaurant"
else
json.set! "marker-color", "#5cb85c"
json.set! "marker-symbol", "lodging"
end
json.set! "marker-size", "small"
json.title "#{year.person.given_name} #{year.person.last_name} was a #{year.title} at #{year.location.address} on #{year.year_date}"
end
if (year.location.longitude)
json.geometry do
json.type "Point"
json.coordinates [year.location.longitude, year.location.latitude]
end
end
end
을합니다. 오직 하나만 나타납니다. 나는 MarkerClusterGroup을 시도해 보았지만 모든 항목이 표시되었지만 오히려 하나의 툴팁에 제목이 누적되어 있습니다. 이 일에 대해 어떤 힌트가 있습니까? 당신이
JS 파일
function makeMap() {
L.mapbox.accessToken = $('body').data('mapboxToken');
var map = L.mapbox.map('map', 'mapbox.streets')
.setView([34.040951, -118.258579], 13);
var featureLayer = L.mapbox.featureLayer()
.loadURL('map/map_data.geojson')
.addTo(map);
featureLayer.on('ready', function(e) {
map.fitBounds(featureLayer.getBounds());
});
}