Skip to content

Guide

This repository provides custom layer implementations for both MapLibre GL JS and Mapbox GL JS.

Architecture

This monorepo follows a three-tier architecture to maximize code reuse:

Tier 1: Core Runtimes (Engine-agnostic)

Tier 2: Adaptor Helpers

Tier 3: Product Packages (Host-specific)

Quick Start

MapLibre ECharsLayer

Install

Note: Most users only need to install the product packages for their map library. The core and adaptor packages are internal dependencies that are automatically bundled.

sh
$ pnpm add @naivemap/maplibre-gl-echarts-layer echarts
sh
$ npm install @naivemap/maplibre-gl-echarts-layer echarts
sh
$ yarn add @naivemap/maplibre-gl-echarts-layer echarts

Usage

ts
import EChartsLayer from '@naivemap/maplibre-gl-echarts-layer'

const layer = new EChartsLayer('echarts-layer', option)
map.addLayer(layer)

MapLibre ImageLayer

Install

sh
$ pnpm add @naivemap/maplibre-gl-image-layer proj4
sh
$ npm install @naivemap/maplibre-gl-image-layer proj4
sh
$ yarn add @naivemap/maplibre-gl-image-layer proj4

Usage

ts
import ImageLayer from '@naivemap/maplibre-gl-image-layer'

const layer = new ImageLayer('image-layer', option)
map.addLayer(layer)

Mapbox EChartsLayer

Install

sh
$ pnpm add @naivemap/mapbox-gl-echarts-layer echarts
sh
$ npm install @naivemap/mapbox-gl-echarts-layer echarts
sh
$ yarn add @naivemap/mapbox-gl-echarts-layer echarts

Usage

ts
import EChartsLayer from '@naivemap/mapbox-gl-echarts-layer'

const layer = new EChartsLayer('echarts-layer', option)
map.addLayer(layer)

Mapbox ImageLayer

Install

sh
$ pnpm add @naivemap/mapbox-gl-image-layer proj4
sh
$ npm install @naivemap/mapbox-gl-image-layer proj4
sh
$ yarn add @naivemap/mapbox-gl-image-layer proj4

Usage

ts
import ImageLayer from '@naivemap/mapbox-gl-image-layer'

const layer = new ImageLayer('image-layer', option)
map.addLayer(layer)