Page cover

Route Optimization for Cleaning Operations

A Use Case Guide for implementing an Optimized Cleaning Route functionality. Learn how to select locations, generate the most efficient route, and navigate cleaning tasks step by step.

circle-info

This guide currently focuses on displaying the capabilities of the MapsIndoors Web SDK.

Introduction

A common challenge for cleaning staff in large offices, hospitals, and airports is determining an optimized route that allows them to clean all required areas as efficiently as possible.

This use case guide shows one recommended approach for implementing a “Optimized Cleaning Route” feature in a MapsIndoors-powered application:

  1. The user chooses a list of locations that needs to be cleaned

  2. The app calculates an optimized cleaning route

  3. The user later marks the location as Clean and navigates to the next location.

Cleaning Rooms Module

A reusable, data-source agnostic module for managing room cleaning workflows with MapsIndoors integration.

CleaningModule handles all cleaning-related functionality, including:

  • Room status management. (clean, needs-cleaning, in progress)

  • Interactive room slection and info cards.

  • Route planning and navigation.

  • UI rendering and updates.

The module uses dependency injection making it compatible with any data source that implements the required interface.

MapsIndoors Features

Additional Features

  • Room status management (clean, needs-cleaning, in-progress).

  • Route planning with room checklist and selection tools

  • Optimized route calculation and step-by-step navigation.

  • Configurable start/end points for routes.


Get Started

Installation

Import the module in your ES6 application:

Dependencies

chevron-rightRequired HTML Elementshashtag
chevron-rightRequired CSS Classeshashtag

Quick Start

Room Store Interface

Any room store passed to CleaningModule must implement:

Using the Built-in RoomStore

Creating a Custom Room Store

API References

Constructor

Option
Type
Is Required?
Description

mapsIndoors

Object

Yes

MapsIndoors

instance

mapbox

Object

Yes

Mapbox GL

instance

directionsService

Object

Yes

MapsIndoors

DirectionsService

DirectionsRenderer

Object

Yes

MapsIndoors DirectionsRenderer

roomStore

Object

Yes

Room data store implementing required interface

config

Object

Yes

Configuration object

Room Status Methods

updateRoomStatus(roomId, newStatus)

Updates a room's status and refreshes all UI components.

updateRoomDisplayRules()

Applies MapsIndoors display rules based on room statuses (colors polygons on map).

UI rendering Methods

renderRoomList()

Renders the room list in the sidebar, sorted by status priority.

updateInfoCard(roomId)

Shows and populates the info card for a specific room.

populateRoomDropdowns()

Populates all room selection drop-downs.

populateSelectedRooms()

Renders the room checklist for route planning.

Room Selection Methods

selectRoom(roomId, shouldFlyTo = false)

Selects a room and optionally flies the camera to it.

closeSelection()

Deselects the current room and hides the info card.

Route Planning Methods

addRoomToRoute(roomId)

Adds a room to the cleaning route.

removeRoomFromRoute(roomId)

Removes a room from the cleaning route.

selectRandomRooms(count = 10)

Selects random rooms that need cleaning.

selectAllRooms()

Selects all rooms that need cleaning.

clearSelectedRooms()

Clears all selected rooms from the route.

cleaningModule.clearSelectedRooms();

Route Navigation Methods

async calculateRoute()

Calculates and displays the optimized cleaning route.

nextStop()

Navigates to the next stop in the route.

previousStop()

Navigates to the previous stop in the route.

clearRoute()

Clears the current route from the map.

Utility Methods

clearElementCache()

Clears the DOM element cache. Call this if DOM structure changes dynamically.

Properties

Property
Type
Description

selectedRoomId

string | null

Currently selected room ID

currentRoute

Object | null

Current route result from directions service

currentLegIndex

number

Current position in route navigation

routeRooms

string[]

Array of room IDs selected for the route


Examples

chevron-rightExample 1: Basic Setup with Event Listenershashtag

chevron-rightExample 2: Testing with Mock Storehashtag

chevron-rightExample 3: Integrating with Backend APIhashtag

Status Flow

Last updated

Was this helpful?