SPB Git

Repository Public

main.tsx 2.8 KB 84 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : KA Maps Engine8 * File             : sdk/web/tests/vite-app/src/main.tsx9 * Module           : sdk10 * Repository       : https://git.spboucher.ai/ka-maps-engine11 * Created          : 2026-12-0112 * Last Modified    : 2026-12-0113 *14 * Author           : Simon-Pierre Boucher15 * Position         : Professor of Finance16 * Institution      : Université du Québec en Outaouais (UQO)17 * Organization     : SP Boucher18 * Website          : https://spboucher.ai19 * Git              : https://git.spboucher.ai20 *21 * Preferred Contact: support@spboucher.ai22 * Development      : dev@spboucher.ai23 * Support          : support@spboucher.ai24 * Security/Admin   : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License          : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142import { StrictMode } from 'react';43import { createRoot } from 'react-dom/client';44import { KaLayer, KaMapView, useKaMapEvent } from '@ka/maps/react';45import { VERSION, type KaMap } from '@ka/maps';4647declare global {48  interface Window {49    __kaVite?: { ready: boolean; error?: string; map?: KaMap };50  }51}5253function Ready() {54  useKaMapEvent('load', () => {55    window.__kaVite = { ...window.__kaVite, ready: true };56  });57  return null;58}5960function App() {61  return (62    <div className="page">63      <h1>KA Maps {VERSION} — Vite + React</h1>64      <KaMapView65        className="carte"66        aria-label="Carte d’essai Vite"67        options={{ app: 'immoka', center: [-71.208, 46.8139], zoom: 14, controls: true }}68        onReady={(map) => (window.__kaVite = { ready: map.isLoaded, map })}69        onError={(e) => (window.__kaVite = { ready: false, error: `${e.code}: ${e.message}` })}70        fallback={<p role="alert">Carte indisponible</p>}71      >72        <Ready />73        <KaLayer id="ici" type="markers" data={[{ id: 1, lon: -71.208, lat: 46.8139, label: 'Québec', value: 1 }]} />74      </KaMapView>75    </div>76  );77}7879createRoot(document.getElementById('root')!).render(80  <StrictMode>81    <App />82  </StrictMode>,83);84
Files main
Menu

Theme