OptionalcategoryCustom icons for specific place categories, which places in those categories use instead of the default style.
A place takes the entry for its own category, and a plain sub-category such as SCHOOL_GENERIC
then the entry for its parent, SCHOOL, with or without an image.
Otherwise, it takes the first entry for the map category its category falls in, as the map's
own POIs do. For example, RESTAURANT reaches an ITALIAN_RESTAURANT, and CAFE a CAFE_PUB.
That last match takes only entries with an image, so given the same list as
POIsModuleConfig.icon, a place it reaches draws the icon of the map's own POIs.
OptionaldefaultConfiguration for the default place icon. The default icon is the one used for clicked locations and addresses without a specific category, or via custom mapping.
OptionalmappingA custom mapping that picks the icon of each place.
fn receives places of the shape the module was created for, so your own properties
are typed. A poiCategory resolves through the marker type, as a place's own
category does.
// 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' } },
});
OptionalopacityOpacity of the place icons, from 0 to 1, whichever marker type draws them. The labels take
label.opacity. The cluster badges and a highlighted or selected place stay opaque, so a
selected place still stands out.
The icons of place markers, including custom icons.
Example