Parking Spot: Mark & Navigate Back
Introduction
A common “last 200 meters” problem in large campuses, hospitals, airports, shopping centers, and multi-level parking garages is simply remembering where you parked and later finding your way back to that same location
This use case guide shows one recommended approach for implementing a “Mark my parking spot” feature in a MapsIndoors-powered application:
The user marks a parking spot on the map (using their live position or a dropped pin)
The app saves that spot (typically per-user)
Later, the user can request directions back to that exact spot using the same wayfinding experience already in your MapsIndoors app
ParkingManager
A reusable ES Module for parking spot management that integrates with MapsIndoors SDK.
Table of Contents
Overview
Summary
Installation
Quick Start
API Reference
Storage Adapters
MapsIndoors Integration
Examples
Overview
ParkingManager provides a simple API to save, load, and manage parking spot locations. It's designed to work seamlessly with MapsIndoors SDK location objects and supports configurable storage backends.
MapsIndoors Features
Additional Features
Save MapsIndoors locations as parking spots
Persistent storage via localStorage or cookies
Custom storage adapter support
Saved Data Structure
When a parking spot is saved, ParkingManager stores the following data:
Summary
A “Mark & Navigate Back” parking workflow is a compact but high-impact MapsIndoors use case:
Save a point (usually per user)
Render it clearly
Route back using MapsIndoors wayfinding components
Because the pattern is generic (save a coordinate + optional floor + navigate later), you can reuse the same architecture for many other use cases like “Find my desk”, “Return to entrance”, “Meet me here”, or “Remember this place”.
Browser Support
ParkingManager requires ES6+ support and works in all modern browsers:
Chrome 61+
Firefox 60+
Safari 11+
Edge 16+
For localStorage adapter, ensure localStorage is available. For cookie adapter, ensure cookies are enabled.
Installation
Include the module in your HTML file with ES module support:
Import in your JavaScript:
Quick Start
API Reference
ParkingManager
Constructor
storageAdapter
Object
LocalStorageAdapter
Storage backend to use
storageKey
string
'savedParkingSpot'
Key used for storage
Methods
saveParkingSpot(mapsIndoorsLocation)
Saves a MapsIndoors location as the parking spot.
mapsIndoorsLocation
Object
MapsIndoors location object
Returns: boolean - true if save was successful
loadParkingSpot()
Loads the saved parking spot data.
Returns: Object | null - Saved parking data or null if none exists
clearParkingSpot()
Clears the saved parking spot.
Returns: boolean - true if clear was successful
hasSavedParking()
Checks if a parking spot is saved.
Returns: boolean - true if a parking spot exists
Storage Adapters
LocalStorageAdapter (Default)
Uses browser localStorage for persistent storage.
prefix
string
''
Prefix for storage keys
CookieStorageAdapter
Uses browser cookies with configurable expiration.
expireDays
number
7
Days until cookie expires
path
string
'/'
Cookie path
secure
boolean
false
Require HTTPS
sameSite
string
'Lax'
SameSite attribute
Custom Storage Adapter
Create your own adapter by implementing the storage interface:
Example: SessionStorage Adapter
MapsIndoors Integration
Complete Setup Example
Saving Parking from Location Click
Navigating to Saved Parking
Getting Directions to Parking
Examples
Last updated
Was this helpful?
