Skip to content

Latest commit

 

History

History
285 lines (207 loc) · 10.8 KB

File metadata and controls

285 lines (207 loc) · 10.8 KB

GeoView Documentation

Welcome to the GeoView documentation! This documentation is organized by audience and use case.

📖 For GeoView Users (API Documentation)

API Reference

Location: app/api/

Complete API reference for interacting with GeoView:

Layers

Location: app/layers/

Layer types, configuration, and management:

Events

Location: app/events/

Event system and event handling:

Configuration

Location: app/config/

Map creation and configuration:

Packages

Location: app/packages/

Package system and development:

Testing

TypeScript API Reference (TypeDoc)

📚 Complete API Reference: For detailed TypeScript interfaces, types, classes, and functions, see our auto-generated TypeDoc API Documentation

What's in TypeDoc:

  • ✓ All exported classes, interfaces, and types
  • ✓ Complete function signatures with parameter details
  • ✓ JSDoc comments and usage examples
  • ✓ Cross-referenced type definitions
  • ✓ Event payload types and validation functions

Use TypeDoc for:

  • Looking up exact type definitions
  • Finding all available methods on a class
  • Understanding event payload structures
  • Exploring internal class hierarchies
  • TypeScript type checking in your IDE

🔧 For GeoView Developers (Internal Development)

Location: programming/

Best practices and patterns for contributing to GeoView core:

🔌 For Packages & Extension Developers

Location: app/

Guides for extending GeoView functionality:

Package Development

Documentation Organization

📂 Documentation Structure:

📋 Additional Resources

UI & Theming

Configuration

🗺️ Documentation Quick Navigation

Common Tasks

Task Documentation
Create a map Creating Maps
Add a layer Layer API
Create a package Core Package Development
Handle events Event Processors
Use utilities API Utilities
Draw geometry Geometry API
Run tests Test Suite Guide
Contribute code Best Practices

📁 Documentation Structure

docs/
+-- README.md (this file)
+-- app/
    +-- api/              # API reference documentation
    +-- config/           # Map configuration and creation
    +-- layers/           # Layer types and configuration
    +-- events/           # Event system documentation
    +-- packages/         # Packages
    +-- testing/          # Test suite documentation
    +-- ui/               # UI and theming
    +-- *.md              # Extension development guides
+-- programming/          # Internal development practices

TypeDoc (Auto-generated):
+-- docs/typedoc/         # Complete TypeScript API reference
    +-- modules.html      # All exported modules
    +-- classes/          # Class documentation
    +-- interfaces/       # Interface definitions
    +-- types/            # Type definitions
    +-- functions/        # Function signatures

Documentation Types Explained

Type Location Purpose When to Use
API Reference docs/app/api/ Complete API function reference Looking up API methods and parameters
Configuration docs/app/config/ Map creation and configuration Setting up maps and configuring GeoView
TypeDoc Reference docs/typedoc/ Complete TypeScript API definitions Looking up exact types and signatures
Developer Guides docs/programming/ Internal architecture and patterns Contributing to GeoView core
Extension Guides docs/app/packages/ Creating packages Building GeoView extensions

💡 Key Concepts

Events vs Actions

GeoView uses a clear separation between listening to events and performing actions:

  • Events (Listening): Use MapViewer/Layer event handlers
    • Example: cgpv.api.getMapViewer('map1').onMapMoveEnd((payload) => { ... })
  • Actions (Modifying State): Use Event Processor static methods
    • Example: MapEventProcessor.setView('map1', center, zoom)

See Event Processors Guide for details on the architecture.

Package Development

Package development uses TypeScript and the monorepo structure. See the Core Package Development Guide for complete instructions.

✍️ Contributing to Documentation

When adding documentation:

  1. API docs → Add to app/api/
  2. Configuration docs → Add to app/config/
  3. Layer docs → Add to app/layers/
  4. Event docs → Add to app/events/
  5. Package docs → Add to app/packages/
  6. Internal practices → Add to programming/
  7. Update this README with links
  8. Add cross-references to related docs

API ACCESS TO MAP DEPRECATED

The api.maps array is now private and only accessible from the api. The cgpv.api.maps is not available anymore. To access and interact with the maps, new functions have been added.

  • How to get a list of maps available
/**
 * Gets the list of all map IDs currently in the collection.
 *
 * @returns {string[]} Array of map IDs
 */
getMapViewerIds(): string[]
  • How to know if a map exist
/**
 * Return true if a map id is already registered.
 *
 * @param {string} mapId - The unique identifier of the map to retrieve
 * @returns {boolean} True if map exist
 */
hasMapViewer(mapId: string): boolean
  • How to access a map by id
/**
 * Gets a map viewer instance by its ID.
 *
 * @param {string} mapId - The unique identifier of the map to retrieve
 * @returns {MapViewer} The map viewer instance if found
 * @throws {Error} If the map with the specified ID is not found
 */
getMapViewer(mapId: string): MapViewer

Implementation

const myMap = cgpv.api.getMapViewer("Map1");
myMap.layer.addGeoviewLayerByGeoCoreUUID(layer);
  • How to delete a map instance
/**
 * Delete a map viewer instance by its ID.
 *
 * @param {string} mapId - The unique identifier of the map to delete
 * @param {boolean} deleteContainer - True if we want to delete div from the page
 * @returns {Promise<HTMLElement} The Promise containing the HTML element
 */
deleteMapViewer(mapId: string, deleteContainer: boolean): Promise<HTMLElement | void> {

Implementation

if (cgpv.api.hasMapViewer(map)) {
  cgpv.api.deleteMapViewer(map, false).then(() => {
    resolve();
  });
} else {
  resolve();
}