Skip to content

Repository files navigation

@gui-chat-plugin/map

npm version

Google Map location plugin for GUI Chat applications. Display locations on an interactive map.

Features

  • Show any location by name or address
  • Google Maps embed integration
  • Fallback link to open in Google Maps
  • Support for coordinates (lat/lng)

Installation

yarn add @gui-chat-plugin/map gui-chat-protocol

gui-chat-protocol is a peer dependency — install it alongside the plugin; the host application provides the runtime and this plugin only declares the compatible range.

Usage

Vue Integration

// In src/tools/index.ts
import MapPlugin from "@gui-chat-plugin/map/vue";

const pluginList = [
  // ... other plugins
  MapPlugin,
];

// In src/main.ts
import "@gui-chat-plugin/map/style.css";

Core-only Usage

import { executeMap, TOOL_DEFINITION } from "@gui-chat-plugin/map";

// Show a location
const result = await executeMap(context, {
  location: "Tokyo Tower, Japan",
});

API

MapArgs

interface MapArgs {
  location: string; // Location name, address, or coordinates
}

MapToolData

interface MapToolData {
  location: string | { lat: number; lng: number };
}

Configuration

The plugin requires a Google Maps API key to display embedded maps. Pass it via the googleMapKey prop to the view component, or configure it in your app's start response.

Development

# Install dependencies
yarn install

# Run demo
yarn dev

# Build
yarn build

# Lint
yarn lint

Test Prompts

Try these prompts to test the plugin:

  1. "Show me the Eiffel Tower on the map"
  2. "Where is the Sydney Opera House located?"
  3. "Display Tokyo Station on the map"

License

MIT

Related

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages