Loading...
Searching...
No Matches
LocationWindowCommon Directory Reference

Directories

 dart
 
 java
 
 kotlin
 
 objc
 
 swift
 

Detailed Description

This directory contains comprehensive examples demonstrating the usage of LocationWindowCommon components across all supported platforms.

Overview

LocationWindowCommon provides interfaces for working with location windows, views, camera operations, and map objects. It includes:

Key Components

LocationView

LocationWindow

Map Objects

Camera Operations

Listeners

Platform-Specific Files

Dart/Flutter

Java

Kotlin

Objective-C

Swift

Key Documentation Tags

LocationView

LocationWindow Core Methods

Map Objects

Camera Operations

Picking Operations

Listener Operations

Debug Operations

Advanced Features

Common Usage Patterns

1. Basic LocationWindow Setup

// Create LocationView with callback
LocationView locationView = LocationView(
GlobalKey(),
(LocationWindow window) {
// Handle window creation
locationWindow = window;
},
TextDirection.ltr,
);

2. Coordinate Conversion

// Convert screen position to meters
Point screenPoint = Point(100.0, 200.0);
Point metersPoint = locationWindow.screenPositionToMeters(screenPoint);
// Convert meters to screen position
Point metersPoint2 = Point(50.0, 75.0);
Point screenPoint2 = locationWindow.metersToScreenPosition(metersPoint2, true);

3. Map Feature Selection

// Select map feature
String featureId = "room_101";
bool selected = locationWindow.selectMapFeature(featureId);
// Get selected features
List<String> selectedFeatures = locationWindow.selectedMapFeatures;
// Deselect feature
bool deselected = locationWindow.deselectMapFeature(featureId);
// Deselect all features
locationWindow.deselectAllMapFeatures();

4. Zoom Management

// Get current zoom
double currentZoom = locationWindow.zoomFactor;
// Set zoom with limits
locationWindow.zoomFactor = 150.0;
locationWindow.minZoomFactor = 50.0;
locationWindow.maxZoomFactor = 300.0;

5. Camera Operations

// Fly to position
Camera flyCamera = Camera(x: 200.0, y: 200.0, zoom: 2.0);
locationWindow.flyTo(flyCamera, 1000, () {
print("Animation completed");
});
// Move with animation
Camera moveCamera = Camera(x: 150.0, y: 150.0, zoom: 1.8);
locationWindow.moveTo(moveCamera, 800, AnimationType.easeInOut, () {
print("Move completed");
});

6. Map Object Management

// Add map objects
CircleMapObject circle = locationWindow.addCircleMapObject();
IconMapObject icon = locationWindow.addIconMapObject();
PolygonMapObject polygon = locationWindow.addPolygonMapObject();
// Remove map objects
bool removed = locationWindow.removeCircleMapObject(circle);
locationWindow.removeAllMapObjects();

7. Listener Management

// Create listeners
PickListener pickListener = TestPickListener();
InputListener inputListener = TestInputListener();
CameraListener cameraListener = TestCameraListener();
// Add listeners
locationWindow.addPickListener(pickListener);
locationWindow.addInputListener(inputListener);
locationWindow.addCameraListener(cameraListener);
// Remove listeners
locationWindow.removePickListener(pickListener);
locationWindow.removeInputListener(inputListener);
locationWindow.removeCameraListener(cameraListener);

Running Examples

Dart/Flutter

cd dart
dart location_window_common_example.dart

Java

cd java
javac LocationWindowCommonExample.java
java LocationWindowCommonExample

Kotlin

cd kotlin
kotlinc LocationWindowCommonExample.kt -include-runtime -d example.jar
java -jar example.jar

Objective-C

cd objc
clang -framework Foundation LocationWindowCommonExample.m -o example
./example

Swift

cd swift
swift LocationWindowCommonExample.swift

Notes

Advanced Features

Filtering

Apply filters to map layers for dynamic content management:

locationWindow.applyFilter("type:room", "venues");
locationWindow.applyFilter("floor:1", "buildings");

Debug Flags

Enable debug features for development:

LocationWindow.setDebugFlag(DebugFlag.showGrid, true);
LocationWindow.setDebugFlag(DebugFlag.showBeacons, true);
bool enabled = LocationWindow.getDebugFlag(DebugFlag.showGrid);

Animation Types

Use different animation types for camera movements:

List<AnimationType> types = [
AnimationType.linear,
AnimationType.easeIn,
AnimationType.easeOut,
AnimationType.easeInOut
];

Performance Considerations

Error Handling