import { type MapMarkerProperties } from '@arenarium/maps';
const count = 100;
const radius = 10;
const lat = 39.8283;
const lng = -98.5795;
// Create markers
const markers: MapMarkerProperties[] = [];
for (let i = 0; i < count; i++) {
const id = i.toString();
markers.push({
// A unique identifier for the marker
id: id,
// The rank of the marker, used for prioritization
rank: i,
// The latitude of the marker's location
lat: lat + (Math.random() - 0.5) * radius,
// The longitude of the marker's location
lng: lng + (Math.random() - 0.5) * radius,
// The tooltip configuration of the marker (required)
tooltip: {
// Callback function that returns the HTMLElement object for the tooltip body
element: getTooltipElement(id),
// (Optional) The desired dimensions of the marker's tooltip area
dimensions: { height: 32 + (i % 16), width: 64 + (i % 16), padding: 6 },
// (Optional) The tooltip-specific style
style: { background: '#ffffff', filter: 'drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3))', radius: 8 }
// (Optional) The tooltip initialze callback, called when visible for the first time
// initialize: async (id, element) => { }
},
// (Optional) The pin configuration of the marker
pin: {
// (Optional) Callback function that returns the HTMLElement object for the pin body
element: getPinElement(),
// (Optional) The desired dimensions of the marker's pin area
dimensions: { radius: 8, stroke: 1 },
// (Optional) The pin-specific colors
style: { background: '#008800', stroke: '#000000' }
// (Optional) The pin initialze callback, called when visible for the first time
// initialize: async (id, element) => { }
},
// (Optional) The popup configuration of the marker
popup: {
// Callback function that returns the HTMLElement object for the popup body
element: getPopupElement(id),
// (Optional) The desired dimensions of the marker's popup area
dimensions: { height: 96 + (i % 16), width: 128 + (i % 16), padding: 6 },
// (Optional) The popup-specific colors
style: { background: '#ffffff', filter: 'drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3))', radius: 8 }
// (Optional) The popup initialze callback, called when visible for the first time
// initialize: async (id, element) => { }
}
});
}
mapManager.updateMarkers(markers);