glcvdv-lite-api-map
Version:
A lightweight API for interactive hotel maps with Mapbox integration
22 lines • 997 B
JavaScript
import { setupHotelSource } from './setup-hotel-source';
import { setupClusters } from './setup-clusters';
import { addMapInteractions } from './add-map-interactions';
export const updateSource = (map, hotels, options) => {
map.removeLayer('hotels');
map.removeLayer('cluster-count');
map.removeLayer('clusters');
map.removeSource('hotels');
map.removeInteraction('places-mouseenter-interaction');
map.removeInteraction('places-mouseleave-interaction');
map.removeInteraction('places-click-interaction');
map.removeInteraction('click-clusters');
map.removeInteraction('click-unclustered-point');
map.removeInteraction('clusters-mouseenter');
map.removeInteraction('clusters-mouseleave');
map.removeInteraction('unclustered-mouseenter');
map.removeInteraction('unclustered-mouseleave');
setupHotelSource(map, hotels, options);
setupClusters(map, options);
addMapInteractions(map, options);
};
//# sourceMappingURL=update-source.js.map