Skip to Content
ExamplesPlace Markers

Place Markers

Why place markers exist: Place markers (stores, POIs, etc.) help users identify locations on the map. The SDK automatically handles marker visibility based on floors, ensuring users only see relevant markers for the currently displayed floor.

Why automatic floor management: In multi-floor venues, showing all markers simultaneously would create visual clutter. Automatic floor filtering ensures users only see markers relevant to their current floor, improving map clarity and usability.

The SDK provides functionality to add custom markers for places on the map. These markers can display logos or text and are automatically managed based on the current floor.

Adding Place Markers

Why logos vs text: Places with logos display their branding (better recognition), while places without logos fall back to text labels (ensures all places are visible).

// Add a place marker with logo (if available) or text (fallback) // Markers are automatically shown/hidden based on current floor lzMap.addPlaceMarker( place = sdkPlace, // Place data from LzSdkManager.getPlace() or getSubPlaces() markerSize = 240 // Size in pixels (larger = more visible but takes more space) ) { result -> result.onSuccess { placeMarker -> println("Place marker added successfully: ${placeMarker.place.name}") // Marker is now visible if its floor matches current displayed floor }.onFailure { error -> println("Failed to add place marker: ${error.message}") } }

Managing Place Markers

// Get all place markers val allMarkers = lzMap.getPlaceMarkers() // Get markers for a specific floor val floorMarkers = lzMap.getPlaceMarkersForFloor("floor_id") // Remove a specific place marker lzMap.removePlaceMarker("place_id") // Clear all place markers lzMap.clearAllPlaceMarkers()

Custom Annotations with Full Styling

For markers that require full visual customization (icon tinting, text labels, background colors, shape control), use LzAnnotationConfiguration with addAnnotationWith(). This API provides feature parity with the iOS SDK’s LZAnnotationConfiguration.

val config = LzAnnotationConfiguration.builder("custom-poi", LatLng(-33.45, -70.66)) .text("Information Desk") .textColor("#FFFFFF") .textFontSize(13f) .textPosition(TextPosition.BOTTOM) .textBackgroundColor("#1565C0") .iconColor("#1565C0") .iconSize(1.3f) .iconCornerRadius(8f) .borderColor("#0D47A1") .floorId("floor-1") .build() lzMap.addAnnotationWith(config) { result -> result.onSuccess { markerId -> println("Custom annotation added: $markerId") } }

For a complete guide to all customization options, see Marker Customization.

Automatic Floor Management

Why automatic management is essential: Manually managing marker visibility for each floor change would be error-prone and require significant code. Automatic management ensures markers are always correctly displayed, reducing bugs and simplifying implementation.

Place markers are automatically shown/hidden based on the current floor being displayed:

  • Outdoor markers: Always visible (no floor restriction)
  • Indoor markers: Only visible when their floor matches the current displayed floor
  • Floor changes: Markers are automatically updated when the user changes floors (no manual intervention needed)
// When changing floors, place markers are automatically updated // You don't need to manually show/hide markers - the SDK handles it lzMap.setFloorById("new_floor_id") { println("Floor changed and place markers updated automatically") // All markers for the new floor are now visible // Markers for other floors are automatically hidden }
Last updated on