NBMap GL is a web map SDK for JavaScript that enables interactive maps with NextBillion's vector tiles and API services in your web apps.
NBMap GL is a web map SDK for JavaScript that enables interactive maps with NextBillion's vector tiles service in your web apps, basing on Maplibre.
Before start, please install Node.js and yarn to install dependencies.
``bash`
yarn
You can start developing with this command:
`bash`
yarn dev
You can build a minified version of the SDK with this command:
`bash`
yarn build
Html
NBMap GL Basic Example
`
Typescript
`Typescript
import '@nbai/nbmap-gl/dist/nextbillion.css';
import nextbillion, { Map, Marker } from '@nbai/nbmap-gl';nextbillion.setApiKey('Your API key');
const nbmap = new Map({
container: 'map',
style: 'https://api.nextbillion.io/maps/streets/style.json',
zoom: 11,
center: { lat: 34.08572, lng: -118.324569 },
});
nbmap.on('load', () => {
const marker: Marker = new Marker()
.setLngLat({ lat: 34.08572, lng: -118.324569 })
.addTo(nbmap.map);
})
``