Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@antv/l7-mapkit

Package Overview
Dependencies
Maintainers
72
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
This package has malicious versions linked to the ongoing "Mini Shai-Hulud" supply chain attack.

Affected versions:

0.6.00.7.0
View campaign page

@antv/l7-mapkit

React components for AntV L7 geospatial visualization

latest
Source
npmnpm
Version
0.5.0
Version published
Weekly downloads
93
-31.62%
Maintainers
72
Weekly downloads
 
Created
Source

@antv/l7-mapkit

React components for AntV L7 geospatial visualization library. Built on React 18+ and @antv/l7 2.25+.

Features

  • 🎯 Flat Props API - Direct props like colorField, sizeValues, shape instead of nested objects
  • ⚡ Event Handling - Events directly attached to components (onClick, onMouseEnter) without separate event components
  • 🧩 Composable - Component composition pattern inspired by mapcn design philosophy
  • 📦 TypeScript First - Complete type definitions with JSDoc documentation
  • 🤖 LLM Friendly - Includes llms.txt and comprehensive API docs for AI assistants
  • 🗺️ Multiple Maps - Supports GaodeMap (高德) and built-in Map (no third-party dependency)

Installation

npm install @antv/l7-mapkit @antv/l7 @antv/l7-maps

Quick Start

import { GaodeMapScene, PointLayer } from '@antv/l7-mapkit';

const data = {
  type: 'FeatureCollection',
  features: [
    { type: 'Feature', geometry: { type: 'Point', coordinates: [120.19, 30.26] }, properties: { value: 80 } },
    { type: 'Feature', geometry: { type: 'Point', coordinates: [121.47, 31.23] }, properties: { value: 120 } },
  ],
};

function App() {
  return (
    <GaodeMapScene
      style={{ width: '100%', height: '400px' }}
      mapConfig={{ zoom: 7, center: [120.5, 30.8] }}
    >
      <PointLayer
        source={data}
        colorField="value"
        colorValues={['#fee5d9', '#fc4e2a', '#800026']}
        size={8}
        shape="circle"
        onClick={(e) => console.log(e.feature.properties)}
      />
    </GaodeMapScene>
  );
}

Components

Scene Components

  • <GaodeMapScene> - Gaode Map container component
  • <MapScene> - Built-in map container (no third-party dependency)

Layer Components

All layer components share the same flat props interface:

  • <PointLayer> - Point/scatter layer
  • <LineLayer> - Line/path layer (supports arc, greatcircle shapes)
  • <PolygonLayer> - Polygon/area layer
  • <HeatmapLayer> - Heatmap layer (2D/3D/hexagon/grid)
  • <RasterLayer> - Raster/tile layer
  • <ImageLayer> - Image overlay layer
  • <CityBuildingLayer> - 3D building layer

Interactive Components

  • <Marker> - Map marker with custom React content
  • <MarkerLayer> - Batch markers with clustering support
  • <Popup> - Map popup with custom React content
  • <Control> - Built-in controls (zoom/scale/logo/layerSwitch/etc.)
  • <CustomControl> - Custom control with any React content
  • <LoadImage> / <LoadImages> - Load image resources

Hooks

  • useScene() - Get current Scene instance (must be used inside Scene components)
  • useLayer() - Get current Layer instance (must be used inside layer children)

Layer Props Reference

PropTypeDescription
sourceanyData source (GeoJSON/array/URL) required
sourceConfigobjectData parser config { parser: { type: 'json', x: 'lng', y: 'lat' } }
colorstringFixed color value
colorFieldstringColor mapping field name
colorValuesstring[] | fnColor mapping values or callback
sizenumberFixed size in pixels
sizeFieldstringSize mapping field name
sizeValuesnumber[] | fnSize mapping range [min, max]
shapestringShape type (circle/triangle/arc/etc.)
styleobjectLayer style { opacity, stroke, strokeWidth }
filterFieldstringFilter field name
filterValuesany[] | fnFilter values or callback
animateobjectAnimation config { enable, speed, trailLength }
activeboolean | objectHover highlight
selectboolean | objectClick selection
onClickfnClick event handler
onMouseEnterfnMouse enter handler
onMouseLeavefnMouse leave handler
onLoadedfn(layer, scene)Layer loaded callback

Migration from 2.x

L7-MapKit 3.0 is a complete rewrite with breaking changes:

Before (2.x)

<PointLayer
  source={{ data }}
  color={{ field: 'value', values: ['red', 'blue'] }}
  size={{ field: 'count', values: [5, 20] }}
/>
<LayerEvent type="click" handler={handleClick} />

After (3.0)

<PointLayer
  source={data}
  colorField="value"
  colorValues={['red', 'blue']}
  sizeField="count"
  sizeValues={[5, 20]}
  onClick={handleClick}
/>

Key changes:

  • ✅ Flat props instead of nested objects
  • ✅ Events directly on components (no LayerEvent/SceneEvent)
  • ✅ All class components converted to function components with hooks
  • ✅ Only GaodeMap and built-in Map supported (Mapbox removed)
  • ✅ React 18+ only (uses useId, strict mode safe)

Documentation

  • Full API Reference
  • LLM-friendly docs

Development

# Install dependencies
npm install

# Type check
npm run type-check

# Build
npm run build

# Watch mode
npm run dev

License

MIT

FAQs

Package last updated on 13 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts