npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mapslibvn/web

v0.16.0

Published

Bản đồ Việt Nam cho web: nhúng bản đồ MapLibre với tiles PMTiles, marker, ô tìm kiếm địa điểm và dẫn đường từng bước (Vietnam map SDK for web)

Downloads

3,213

Readme

@mapslibvn/web

npm version npm downloads minzipped size license

Website · Pricing · Docs

A production-ready web map SDK for Vietnam. @mapslibvn/web wraps MapLibre GL JS and PMTiles into a single createMap() call — vector tiles, Vietnamese/English labels, a built-in accessible search box, and turn-by-turn navigation, with attribution handled correctly out of the box.

Framework-agnostic: drop it into a plain HTML page via <script>, or use it as the engine under @mapslibvn/react.

Why teams pick it

  • 🗺️ One call to a working map — createMap() sets up the style, vector tiles (via PMTiles, no tile server to run), attribution and language in one step.
  • 🔎 Autocomplete that just works — the <mapslibvn-autocomplete> Web Component ships as an accessible ARIA combobox (keyboard navigation, live region, debounced requests) that drops into any stack — vanilla JS, Vue, Svelte, plain HTML — no React required.
  • 🧭 Turn-by-turn navigation layer — route rendering, camera follow, automatic rerouting and Vietnamese voice guidance (Web Speech API) via map.navigation.
  • 🌐 Bilingual labels — switch between Vietnamese and English map labels at runtime with applyLanguage; sovereignty-sensitive labels always stay in Vietnamese.
  • 📦 Ship it your way — a tree-shakeable ESM build (dist/index.js, ≤ 15 kB gzip) for bundlers, or a self-contained UMD bundle with MapLibre and PMTiles baked in for a plain <script> tag.
  • ⚖️ Attribution can't be silently dropped — createMap always injects the required attribution control; there's no option to hide it, by design.

Install

npm install @mapslibvn/web maplibre-gl@^6.4.1

MapLibre GL JS 6 requires a WebGL2-capable browser. Load MapLibre's CSS once at your app's entry point.

Quick start (ESM)

import { createMap } from '@mapslibvn/web';
import * as maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';

const map = createMap(
  {
    container: 'map',
    apiKey: 'mlv_live_…',
    apiBase: 'https://api.ai-solutions.io.vn',
    center: [106.7, 10.776],
    zoom: 13,
  },
  { maplibre: maplibregl },
);

The UMD build at @mapslibvn/web/umd bundles MapLibre and PMTiles for you. If you copy the UMD file to your own CDN or static folder, place maplibre-gl-worker.mjs and maplibre-gl-shared.mjs next to mapslibvn.umd.js. Don't hide or disable attribution. Never ship a secret key in client-side code — Web keys must be origin-restricted.

📖 Docs: https://mapslibvn-docs.pages.dev/ban-do-web/

📦 Part of the MapsLibVN SDK family: @mapslibvn/core · @mapslibvn/react · @mapslibvn/react-native

Source license: MIT; see THIRD_PARTY_NOTICES.md for dependency and data licenses.


Tiếng Việt

SDK bản đồ web sẵn sàng cho production, dành cho Việt Nam. @mapslibvn/web gói MapLibre GL JS và PMTiles vào đúng một lệnh createMap() — vector tiles, nhãn song ngữ Việt/Anh, ô tìm kiếm dễ tiếp cận có sẵn, và dẫn đường chỉ đường, với attribution được xử lý đúng ngay từ đầu.

Không phụ thuộc framework: nhúng thẳng vào trang HTML thuần bằng <script>, hoặc dùng làm engine bên dưới @mapslibvn/react.

Vì sao nên chọn

  • 🗺️ Một lệnh ra bản đồ chạy được ngay — createMap() dựng sẵn style, vector tiles (qua PMTiles, không cần chạy tile server riêng), attribution và ngôn ngữ trong một bước.
  • 🔎 Autocomplete dùng được ngay — web component <mapslibvn-autocomplete> là một combobox ARIA dễ tiếp cận (điều hướng bàn phím, vùng live, debounce request) nhúng được vào bất kỳ stack nào — vanilla JS, Vue, Svelte, HTML thuần — không cần React.
  • 🧭 Lớp dẫn đường trọn gói — vẽ tuyến, camera bám theo, tự tính lại khi lệch tuyến và đọc thoại tiếng Việt (Web Speech API) qua map.navigation.
  • 🌐 Nhãn song ngữ — đổi nhãn bản đồ giữa tiếng Việt và tiếng Anh ngay lúc chạy bằng applyLanguage; nhãn liên quan chủ quyền luôn giữ tiếng Việt.
  • 📦 Chọn cách đóng gói theo ý bạn — bản ESM tree-shake được (dist/index.js, ≤ 15 kB gzip) cho các bundler, hoặc bản UMD tự chứa đã đóng gói sẵn MapLibre và PMTiles để dùng thẳng bằng thẻ <script>.
  • ⚖️ Không thể lặng lẽ tắt attribution — createMap luôn tự thêm control ghi nguồn bắt buộc; không có tuỳ chọn ẩn nó, đây là chủ đích thiết kế.

Cài đặt

npm install @mapslibvn/web maplibre-gl@^6.4.1

MapLibre GL JS 6 yêu cầu trình duyệt hỗ trợ WebGL2. Nạp CSS của MapLibre một lần ở điểm vào ứng dụng.

Bắt đầu nhanh (ESM)

import { createMap } from '@mapslibvn/web';
import * as maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';

const map = createMap(
  {
    container: 'map',
    apiKey: 'mlv_live_…',
    apiBase: 'https://api.ai-solutions.io.vn',
    center: [106.7, 10.776],
    zoom: 13,
  },
  { maplibre: maplibregl },
);

Bản UMD tại export @mapslibvn/web/umd đóng gói sẵn MapLibre và PMTiles. Nếu chép file UMD sang CDN hay thư mục tĩnh của bạn, đặt maplibre-gl-worker.mjs và maplibre-gl-shared.mjs cạnh mapslibvn.umd.js. Không tắt hoặc che attribution. Không đưa khóa bí mật vào mã nguồn; khóa Web phải giới hạn đúng origin.

📖 Tài liệu: https://mapslibvn-docs.pages.dev/ban-do-web/

📦 Nằm trong họ SDK MapsLibVN: @mapslibvn/core · @mapslibvn/react · @mapslibvn/react-native

Giấy phép mã nguồn: MIT; xem THIRD_PARTY_NOTICES.md cho giấy phép phụ thuộc và dữ liệu.