Broks Randolfs Gailītis 1c2d245f7c
Some checks failed
CI / main (push) Failing after 4m54s
Initial places and map implementation
2025-03-15 12:52:17 +02:00

15 lines
634 B
TypeScript

import { EventData, Page } from '@nativescript/core';
import { HelloWorldModel } from './main-view-model';
import { CartoMap } from '@nativescript-community/ui-carto/ui';
import { MapModel } from './map-view-model';
export function navigatingTo(args: EventData) {
const page = <Page>args.object;
// There are issues with binding the events in the xml file due to naming
// conflicts with the map events (e.g. mapReady) so we use a reference to the map instead
const map = page.getViewById('cartoMap');
map.bindingContext = new MapModel(map as CartoMap);
page.bindingContext = new HelloWorldModel(map.bindingContext);
}