83 System.out.println(
"--- Operating Mode ---");
85 if (locationWindow ==
null) {
86 System.out.println(
"LocationWindow not available yet");
96 System.out.println(
"Operating modes: " + modes.length);
101 System.out.println(
"Set operating mode to OUTDOOR_INDOOR");
105 OperatingMode currentMode = locationWindow.getOperatingMode();
106 System.out.println(
"Current operating mode: " + currentMode);
111 System.out.println(
"Map themes: " + themes.length);
116 System.out.println(
"Set map theme to DARK");
120 MapTheme currentTheme = locationWindow.getMapTheme();
121 System.out.println(
"Current map theme: " + currentTheme);
126 System.out.println(
"Tile kinds: " + kinds.length);
131 System.out.println(
"Tile schemas: " + schemas.length);
135 Map<String, String> query =
new HashMap<String, String>();
136 query.put(
"key",
"YOUR_MAPTILER_KEY");
138 "https://api.maptiler.com/tiles/v3-openmaptiles/{z}/{x}/{y}.pbf",
167 locationWindow.setTileProvider(osmHttp);
168 locationWindow.setTileProvider(
null);
172 "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
178 "© OpenStreetMap contributors",
180 locationWindow.setTileProvider(imagery);
190 locationWindow.setAttributionAlignment(alignment);
194 String attribution = locationWindow.getAttribution();
195 System.out.println(
"Attribution: " + attribution);
203 System.out.println(
"--- setSublocationId Method ---");
205 if (locationWindow ==
null) {
206 System.out.println(
"LocationWindow not available yet");
212 locationWindow.setSublocationId(1);
213 System.out.println(
"Set sublocation ID to 1 (first floor)");
218 locationWindow.setSublocationId(2);
219 System.out.println(
"Set sublocation ID to 2 (second floor)");
224 locationWindow.setSublocationId(0);
225 System.out.println(
"Set sublocation ID to 0 (ground floor)");
229 List<Integer> sublocationIds = Arrays.asList(1, 2, 3, 0, 5);
230 for (Integer
id : sublocationIds) {
231 locationWindow.setSublocationId(
id);
232 System.out.println(
"Switched to sublocation ID: " +
id);
240 System.out.println(
"--- getSublocationId & getEnclosingCamera ---");
242 if (locationWindow ==
null) {
243 System.out.println(
"LocationWindow not available yet");
248 Integer currentId = locationWindow.getSublocationId();
249 if (currentId !=
null) {
250 System.out.println(
"Current sublocation id: " + currentId);
252 System.out.println(
"Current sublocation id is not set");
258 Camera camera = locationWindow.getEnclosingCamera(boundingBox);
259 System.out.println(
"Camera that fits bounding box: " + camera);
264 locationWindow.setFocusRect(focus);
268 Camera padded = locationWindow.getEnclosingCameraWithFocus(boundingBox, focus,
null,
null);
269 System.out.println(
"Camera that fits bounding box in focus rect: " + padded);
277 System.out.println(
"--- Sublocation Change Listener ---");
279 if (locationWindow ==
null) {
280 System.out.println(
"LocationWindow not available yet");
284 DemoSublocationChangeListener listener =
new DemoSublocationChangeListener();
287 locationWindow.addSublocationChangeListener(listener);
288 System.out.println(
"Added sublocation change listener");
291 locationWindow.setSublocationId(1);
292 locationWindow.setSublocationId(2);
295 locationWindow.removeSublocationChangeListener(listener);
296 System.out.println(
"Removed sublocation change listener");
304 System.out.println(
"--- UserLocationLayer ---");
306 if (userLocationLayer ==
null) {
307 System.out.println(
"UserLocationLayer not available yet");
312 userLocationLayer.setVisible(
true);
313 System.out.println(
"User location layer set visible");
317 boolean visible = userLocationLayer.isVisible();
318 System.out.println(
"User location layer is visible: " + visible);
322 ScreenPoint anchor =
new ScreenPoint(100.0f, 200.0f);
323 userLocationLayer.setAnchor(anchor);
324 System.out.println(
"Set user location anchor to: (" + anchor.getX() +
", " + anchor.getY() +
")");
328 boolean anchorEnabled = userLocationLayer.anchorEnabled();
329 System.out.println(
"Anchor enabled: " + anchorEnabled);
333 userLocationLayer.setHeadingModeActive(
true);
334 System.out.println(
"Heading-up mode enabled");
338 boolean headingModeActive = userLocationLayer.headingModeActive();
339 System.out.println(
"Heading-up mode active: " + headingModeActive);
344 System.out.println(
"Follow mode set to heading");
349 System.out.println(
"Follow mode: " + followMode);
353 userLocationLayer.setArrowBitmap(ImageProvider.fromFile(
"/path/to/arrow.png",
true));
354 userLocationLayer.setArrowBitmap(
null);
355 System.out.println(
"Custom arrow bitmap cleared");
359 userLocationLayer.setAccuracyColor(0x4230AAD9);
360 System.out.println(
"Accuracy circle color updated");
364 userLocationLayer.resetAnchor();
365 System.out.println(
"Anchor reset to default");
373 System.out.println(
"--- RouteLayer ---");
375 if (routeLayer ==
null) {
376 System.out.println(
"RouteLayer not available yet");
381 routeLayer.setVisible(
true);
382 System.out.println(
"Route layer set visible");
386 boolean visible = routeLayer.isVisible();
387 System.out.println(
"Route layer is visible: " + visible);
391 routeLayer.setTraveledColor(0xB4787878);
392 System.out.println(
"Traveled color updated");
396 routeLayer.setRemainingColor(0xFF30AAD9);
397 System.out.println(
"Remaining color updated");
401 routeLayer.setWidth(8.0f);
402 System.out.println(
"Route width updated");
407 System.out.println(
"Remaining style set to DOTTED");
412 System.out.println(
"Remaining style: " + remainingStyle);
416 routeLayer.setRemainingPointSize(8.0f, 8.0f);
417 System.out.println(
"Remaining point size updated");
422 System.out.println(
"Remaining placement updated");
426 routeLayer.setRemainingPlacementSpacing(8.0f);
427 System.out.println(
"Remaining placement spacing updated");
431 routeLayer.setRemainingPlacementMinRatio(0.0f);
432 System.out.println(
"Remaining placement min ratio updated");
436 routeLayer.setRemainingCollisionEnabled(
false);
437 System.out.println(
"Remaining collision disabled");
441 routeLayer.setRemainingDashLength(0.5f);
442 System.out.println(
"Remaining dash length updated");
446 routeLayer.setRemainingGapLength(0.4f);
447 System.out.println(
"Remaining gap length updated");
458 routeLayer.setRoute(from, to);
459 System.out.println(
"Static route applied");
463 routeLayer.setTarget(to);
464 System.out.println(
"Guidance target applied");
468 List<RouteView> routes = routeLayer.routes();
469 System.out.println(
"Visible routes: " + routes.size());
473 RouteView selectedRoute = routeLayer.selectedRoute();
474 if (selectedRoute !=
null) {
475 System.out.println(
"Selected route length: " + selectedRoute.
length());
480 if (!routes.isEmpty()) {
481 routeLayer.selectRoute(routes.get(0));
489 System.out.println(
"Route status: " + status);
499 public void onRouteTargetReached() {
500 System.out.println(
"Route target reached");
503 routeLayer.addRouteLayerListener(routeLayerListener);
509 public void onRouteViewsChanged() {
510 System.out.println(
"Route views changed");
514 public void onSelectedRouteChanged(
RouteView route) {
515 System.out.println(
"Selected route changed");
519 public void onRouteViewTap(
RouteView route) {
520 routeLayer.selectRoute(route);
523 routeLayer.addRouteViewListener(routeViewListener);
528 System.out.println(
"Route layer cleared");
536 System.out.println(
"--- Coordinate Conversion Methods ---");
538 if (locationWindow ==
null) {
539 System.out.println(
"LocationWindow not available yet");
545 ScreenPoint screenPoint =
new ScreenPoint(100.0, 200.0);
546 GlobalPoint globalPoint = locationWindow.screenPositionToGlobal(screenPoint);
547 System.out.printf(
"Screen position (%.1f, %.1f) converted to WGS84: (%.6f, %.6f)%n",
552 VisibleRegion visibleRegion = locationWindow.getVisibleRegion();
553 System.out.println(
"Viewport top-left: " + visibleRegion.getTopLeft());
558 System.out.println(
"Focus-rect top-left: " + focusRegion.getTopLeft());
564 ScreenPoint screenPoint2 = locationWindow.globalToScreenPosition(globalPoint2,
true);
565 System.out.printf(
"WGS84 (%.6f, %.6f) converted to screen with clipping: (%.1f, %.1f)%n",
569 List<ScreenPoint> testScreenPoints = Arrays.asList(
570 new ScreenPoint(0.0, 0.0),
571 new ScreenPoint(250.0, 250.0),
572 new ScreenPoint(1000.0, 600.0)
575 for (
int i = 0; i < testScreenPoints.size(); i++) {
576 ScreenPoint screen = testScreenPoints.get(i);
577 GlobalPoint global = locationWindow.screenPositionToGlobal(screen);
578 ScreenPoint backToScreen = locationWindow.globalToScreenPosition(global,
false);
579 System.out.printf(
"Test %d: Screen (%.1f, %.1f) -> WGS84 (%.6f, %.6f) -> Screen (%.1f, %.1f)%n",
580 i, screen.getX(), screen.getY(),
582 backToScreen.getX(), backToScreen.getY());
590 System.out.println(
"--- Map Feature Selection Methods ---");
592 if (locationWindow ==
null) {
593 System.out.println(
"LocationWindow not available yet");
599 String featureId =
"room_101";
600 boolean selected = locationWindow.selectMapFeature(featureId);
601 System.out.println(
"Selected map feature " + featureId +
": " + selected);
606 String featureId2 =
"office_205";
607 boolean selected2 = locationWindow.selectMapFeature(featureId2);
608 System.out.println(
"Selected map feature " + featureId2 +
": " + selected2);
613 List<String> selectedFeatures = locationWindow.getSelectedMapFeatures();
614 System.out.println(
"Currently selected map features: " + selectedFeatures.size() +
" features");
615 for (String feature : selectedFeatures) {
616 System.out.println(
" - " + feature);
622 boolean deselected = locationWindow.deselectMapFeature(featureId);
623 System.out.println(
"Deselected map feature " + featureId +
": " + deselected);
628 boolean deselected2 = locationWindow.deselectMapFeature(featureId2);
629 System.out.println(
"Deselected map feature " + featureId2 +
": " + deselected2);
634 locationWindow.deselectAllMapFeatures();
635 System.out.println(
"Deselected all map features");
640 List<String> remainingFeatures = locationWindow.getSelectedMapFeatures();
641 System.out.println(
"Remaining selected features after deselect all: " + remainingFeatures.size() +
" features");
645 List<String> testFeatureIds = Arrays.asList(
"room_101",
"office_205",
"meeting_room_301",
"cafe_401");
648 for (String featureId : testFeatureIds) {
649 boolean success = locationWindow.selectMapFeature(featureId);
650 System.out.println(
"Selected feature " + featureId +
": " + success);
654 List<String> allSelected = locationWindow.getSelectedMapFeatures();
655 System.out.println(
"All selected features: " + allSelected.size() +
" features");
658 locationWindow.deselectAllMapFeatures();
659 System.out.println(
"Deselected all features at once");
695 System.out.println(
"--- Zoom Properties ---");
697 if (locationWindow ==
null) {
698 System.out.println(
"LocationWindow not available yet");
704 double currentZoom = locationWindow.getZoomFactor();
705 System.out.println(
"Current zoom factor: " + currentZoom);
710 locationWindow.setZoomFactor(150.0);
711 System.out.println(
"Set zoom factor to 150.0");
716 double minZoomFactor = locationWindow.getMinZoomFactor();
717 System.out.println(
"Minimum zoom factor: " + minZoomFactor);
722 locationWindow.setMinZoomFactor(50.0);
723 System.out.println(
"Set minimum zoom factor to 50.0");
728 double maxZoomFactor = locationWindow.getMaxZoomFactor();
729 System.out.println(
"Maximum zoom factor: " + maxZoomFactor);
734 locationWindow.setMaxZoomFactor(300.0);
735 System.out.println(
"Set maximum zoom factor to 300.0");
739 List<Double> testZoomFactors = Arrays.asList(100.0, 125.0, 150.0, 200.0, 250.0);
740 for (Double zoom : testZoomFactors) {
741 locationWindow.setZoomFactor(zoom);
742 System.out.println(
"Changed zoom factor to: " + locationWindow.getZoomFactor());
746 System.out.println(
"Testing zoom limits...");
747 locationWindow.setZoomFactor(locationWindow.getMinZoomFactor());
748 System.out.println(
"Set to minimum zoom: " + locationWindow.getZoomFactor());
750 locationWindow.setZoomFactor(locationWindow.getMaxZoomFactor());
751 System.out.println(
"Set to maximum zoom: " + locationWindow.getZoomFactor());
754 locationWindow.setZoomFactor(100.0);
755 System.out.println(
"Reset zoom factor to default: " + locationWindow.getZoomFactor());