Skip to main content

Barikoi Maps

Build beautiful, interactive maps with Barikoi GL JS - a powerful JavaScript library for creating custom maps with accurate location data.

Interactive Map Playground​

Want to explore our maps interactively? Try our Map Playground - a hands-on environment where you can interact with live maps, test geocoding APIs, and visualize results in real-time.


What is Barikoi Maps?​

Barikoi GL JS is a JavaScript library for interactive, customizable vector maps on the web. It takes map styles and data from the Barikoi Maps API and renders them using WebGL for smooth performance on any device.

Key Features​

  • Vector Maps - Smooth, scalable maps that look sharp on any display
  • Fully Customizable - Complete control over map styling and appearance
  • High Performance - Hardware-accelerated rendering with WebGL
  • Global Coverage - Accurate local data with comprehensive coverage
  • Rich API - Extensive methods for markers, layers, popups, and interactions
  • Responsive - Works seamlessly across desktop, tablet, and mobile

Use Cases​

  • Location-based Applications - Build ride-sharing, delivery, or field service apps
  • Real Estate Platforms - Display property locations with custom markers
  • Business Intelligence - Visualize data with heat maps and clusters
  • Logistics & Tracking - Track vehicles and shipments in real-time
  • Store Locators - Help customers find your business locations

Why Choose Barikoi?​

Accurate Local Data​

Barikoi provides:

  • Detailed street-level data with regional specialization
  • Accurate Points of Interest (POIs)
  • Multi-language support
  • Regular data updates

Developer-Friendly​

  • Simple, intuitive API
  • Comprehensive documentation
  • Live code examples
  • Active support

Cost-Effective​

Competitive pricing with transparent plans tailored for businesses of all sizes.


How to Get Started​

1. Get Your API Key​

Sign up for a free account and get your API key:

👉 Get API Key

2. Choose Your Installation Method​

📦 CDN (Recommended for beginners)

Add these lines to your HTML <head>:

<!-- Barikoi GL CSS -->
<link
rel="stylesheet"
href="https://unpkg.com/bkoi-gl@latest/dist/style/bkoi-gl.css"
/>

<!-- Barikoi GL JS -->
<script src="https://unpkg.com/bkoi-gl@latest/dist/iife/bkoi-gl.js"></script>
Use a specific version in production

Replace @latest with a fixed version like @2.0.4 to avoid unexpected breaking changes.

📦 NPM (For React, Vue, Angular, etc.)

Install via npm:

npm install bkoi-gl

Import in your JavaScript:

import bkoigl from "bkoi-gl";
import "bkoi-gl/dist/bkoi-gl.css";

👉 View framework guides

3. Create Your First Map​

Add a map container to your HTML:

<div id="map" style="width: 100%; height: 500px;"></div>

Initialize the map with JavaScript:

const map = new bkoigl.Map({
container: "map",
style: "https://map.barikoi.com/styles/osm_barikoi_v1/style.json",
center: [90.4071, 23.7925], // Dhaka coordinates [longitude, latitude]
zoom: 11,
accessToken: "YOUR_BARIKOI_API_KEY", // ← Replace this!
});

🎉 That's it! You now have a working map.


Quick Example​

Here's a complete working example:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My First Barikoi Map</title>

<!-- Barikoi GL CSS -->
<link
rel="stylesheet"
href="https://unpkg.com/bkoi-gl@latest/dist/style/bkoi-gl.css"
/>
<!-- Barikoi GL JS -->
<script src="https://unpkg.com/bkoi-gl@latest/dist/iife/bkoi-gl.js"></script>

<style>
body {
margin: 0;
padding: 0;
}
html,
body,
#map {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>

<script>
const map = new bkoigl.Map({
container: "map",
style: "https://map.barikoi.com/styles/osm_barikoi_v1/style.json",
center: [90.4071, 23.7925], // Dhaka [longitude, latitude]
zoom: 11,
accessToken: "YOUR_BARIKOI_API_KEY", // ← Replace this!
});
</script>
</body>
</html>

Core Concepts​

Map Initialization​

Every Barikoi map requires:

  1. Container - HTML element ID to hold the map
  2. Style - URL to the map style JSON
  3. Center - Initial map position [longitude, latitude]
  4. Zoom - Initial zoom level (0-22)
  5. API Key - Your authentication token
const map = new bkoigl.Map({
container: "map", // HTML element ID
style: "https://map.barikoi.com/styles/osm_barikoi_v1/style.json", // Map style URL
center: [90.4071, 23.7925], // [lng, lat]
zoom: 11, // Zoom level
accessToken: "YOUR_BARIKOI_API_KEY", // Your API key
});

Configuration Options Explained​

OptionTypeDescription
containerstringThe id of the HTML element where the map will render
stylestringURL to a Barikoi map style JSON (defines colors, fonts, layers, etc.)
center[lng, lat]Initial map center coordinates — longitude first!
zoomnumberInitial zoom level: 0 = world view, 22 = building level
accessTokenstringYour Barikoi API key from developer.barikoi.com

Coordinate System​

Barikoi uses longitude, latitude order (same as GeoJSON):

// Wrong - latitude first (Google Maps order)
[23.7925, 90.4071];
// Correct - longitude first (GeoJSON order)
[90.4071, 23.7925]; // [longitude, latitude]
Common Mistake: Coordinate Order

Barikoi GL uses [longitude, latitude] (like GeoJSON), not [latitude, longitude] (like Google Maps). Dhaka is [90.4071, 23.7925], not [23.7925, 90.4071].

Map Styles​

Choose from pre-built styles or create your own:

// Light style (default)
style: "https://map.barikoi.com/styles/osm_barikoi_v1/style.json";

// Dark mode
style: "https://map.barikoi.com/styles/barikoi-dark-mode/style.json";

// Planet Style
style: "https://map.barikoi.com/styles/planet_map/style.json";

Bangla Text Rendering​

Barikoi map styles serve Bangla place names as proper Unicode text. Rendering Unicode Bangla correctly requires complex text shaping (conjuncts like ক্ষ, vowel matras, character reordering). Not every map library does this shaping, so depending on what you use, Bangla labels can appear broken - disconnected letters such as পল্লবী showing up as প ল ্ ল ব ী.

If you see broken Bangla labels, pick one of the fixes below.

Option 1: Barikoi GL JS (bkoi-gl) - works out of the box​

bkoi-gl already covers Bangla rendering. No extra setup is needed - install it and Bangla labels render correctly:

npm install bkoi-gl
import bkoigl from "bkoi-gl";
import "bkoi-gl/dist/bkoi-gl.css";

Option 2: MapLibre GL JS - use version 6 or later​

If you use MapLibre GL JS directly (not bkoi-gl), upgrade to v6 or later. Version 6 ships built-in complex text rendering (HarfBuzz-based shaping), so Unicode Bangla renders correctly with no plugins:

npm install maplibre-gl@^6

For CDN / script-tag usage, v6 must be loaded as an ES module:

<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@6/dist/maplibre-gl.css" />
<script type="module">
import * as maplibregl from "https://cdn.jsdelivr.net/npm/maplibre-gl@6/+esm";
// ... create the map here
</script>

Note that v6 is ESM-only (there is no classic <script src> bundle - the old dist/maplibre-gl.js no longer exists) and requires WebGL2. See the v5 to v6 migration guide if you are upgrading an existing app.

Option 3: Complex text plugin (MapLibre GL JS v5 or older)​

If you cannot upgrade to v6 yet, add the community maplibre-gl-complex-text plugin. It runs HarfBuzz (compiled to WebAssembly) through the RTL text plugin hook and supports Bengali along with Devanagari, Tamil, Khmer and 8 other scripts. The plugin is hosted online - no install required, just point at the hosted URL:

maplibregl.setRTLTextPlugin(
"https://wipfli.github.io/maplibre-gl-complex-text/dist/maplibre-gl-complex-text.js",
false
);

const map = new maplibregl.Map({
container: "map",
style: "https://map.barikoi.com/styles/osm_barikoi_v1/style.json?key=YOUR_BARIKOI_API_KEY",
center: [90.4071, 23.7925],
zoom: 11,
transformRequest: (url, resourceType) => {
if (resourceType === "Glyphs") {
const match = url.match(/(\d+)-(\d+)(?:\.pbf)?$/);
if (match) {
const start = parseInt(match[1], 10);
const end = parseInt(match[2], 10);
const encodedRangeStarts = [
63488, 63232, 62976, 62720, 62464, 62208, 61952, 61696, 61440, 61184,
60928, 60672, 60416, 60160, 59904, 59648, 59392, 59136, 58880, 58624,
58368, 58112, 57856, 57600, 3072, 2816, 2560, 2304, 10240, 10752,
];
if (encodedRangeStarts.includes(start)) {
return {
url: `https://wipfli.github.io/pgf-glyph-ranges/font/NotoSansMultiscript-Regular-v1/${start}-${end}.pbf`,
};
}
}
}
return undefined;
},
});
Important for Barikoi styles

The plugin's stock README snippet matches glyph URLs ending in .pbf. Barikoi style glyph URLs end at the range number with no extension (for example /font/Noto Sans Bengali Regular/2304-2559). Use the (\d+)-(\d+)(?:\.pbf)?$ regex from the snippet above - with the stock snippet the redirect never fires and Bangla labels render blank.

This setup was verified against the Unicode Bangla test style https://map.barikoi.com/styles/osm_barikoi_v1_bn_test/style.json with maplibre-gl v5: conjuncts render correctly (পল্টন, সূত্রাপুর, কামরাঙ্গিচার). Without shaping, the same style renders with decomposed conjuncts (সূতরাপুর instead of সূত্রাপুর) and misplaced vowel signs.

Things to know about the plugin:

  • It is a third-party community project (MIT-licensed), and the shaped glyphs are fetched from the plugin author's hosted server. For production apps you can self-host both the plugin script and the glyph ranges from its repository.
  • It cannot be used together with the standard RTL text plugin (Arabic/Hebrew support).
  • Line breaking can be slightly off inside MapLibre ["format"] expressions.
  • Labels render with the plugin's bundled Noto Sans Multiscript font for the shaped scripts, so the Bangla typeface will not match a custom text-font you set.

Zoom Levels Reference​

Zoom LevelWhat You See
0-3Continents / Countries
4-6Large regions
7-10Cities
11-14Neighborhoods
15-18Streets
19-22Buildings

What's Next?​

Learn More​

Add Features​

Use Barikoi APIs​


Migration Guides​

Already using another mapping solution? We make it easy to switch:


Need Help?​

Pro Tip

Start with our Interactive Examples to see live demos and copy working code. It's the fastest way to learn!


Browser Support​

Barikoi GL JS works in all modern browsers that support WebGL:

  • ✅ Chrome (latest)
  • ✅ Firefox (latest)
  • ✅ Safari (latest)
  • ✅ Edge (latest)
  • ✅ Mobile browsers (iOS Safari, Chrome for Android)

Ready to build something amazing? Get your API key and start mapping! 🚀