OptionalcategoryArray of custom icons for specific place categories.
When provided, places matching these categories will use the custom icons instead of the default style.
OptionaldefaultConfiguration for the default place icon.
OptionalmappingCustom mapping to determine the icon for a given place.
Supports two mapping strategies:
imageID: Directly returns the icon image ID to use for the place.
This provides full control over icon selection.
poiCategory: Returns a POI category, which is then resolved to an icon
using the existing category-to-icon logic. This reuses the standard category mapping.
fn receives places of the shape the module was created for, so it reads your own
properties typed.
// Direct image ID mapping
mapping: {
to: 'imageID',
fn: (place) => place.properties.poi?.name?.includes('urgent') ? 'urgent-icon' : 'default-icon'
}
// POI category mapping, from a property of your own
type Venue = CommonPlaceProps & { venueCategory?: MapStylePOICategory };
await PlacesModule.create<Venue>(map, {
icon: { mapping: { to: 'poiCategory', fn: (place) => place.properties.venueCategory ?? 'RESTAURANT' } },
});
Configuration for place marker icons.
Controls the visual appearance of place markers including custom icons.
Example