Get started with angular-mapboxgl-directive CDN
MIT licensed
Angular-mapboxgl-directive is a library for using Mapbox GL JS maps in Angular applications.
Tags:- webgl
- angularjs
- mapbox
- mapboxgl
- javascript
- cli
Stable version
Copied!
How to start using angular-mapboxgl-directive CDN
import { Component } from '@angular/core';
declare const mapboxgl: any; // Add this line for TypeScript
@Component({
selector: 'app-mapbox-example',
template: `
<div style="height: 500px; width: 100%;">
<mapbox-map [style]="mapboxStyle" [accessToken]="accessToken">
<mapbox-geojson [geojson]="geojsonData"></mapbox-geojson>
</mapbox-map>
</div>
`
})
export class MapboxExampleComponent {
mapboxStyle = 'mapbox://styles/mapbox/streets-v11';
accessToken = 'YOUR_ACCESS_TOKEN'; // Replace with your Mapbox access token
geojsonData = {
type: 'FeatureCollection',
features: [
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [-122.4194, 37.7749]
},
properties: {
title: 'San Francisco'
}
}
]
};
ngOnInit() {
mapboxgl.accessToken = this.accessToken; // Set the access token for Mapbox
}
}
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.1.0
0.10.0
0.10.1
0.10.2
0.11.0
0.11.1
0.12.0
0.12.1
0.13.0
0.13.1
0.13.10
0.13.11
0.13.12
0.13.13
0.13.2
0.13.3
0.13.4
0.13.5
0.13.6
0.13.7
0.13.8
0.13.9
0.14.0
0.15.0
0.16.0
0.16.1
0.16.2
0.17.0
0.18.0
0.18.1
0.18.2
0.19.0
0.20.0
0.21.0
0.22.0
0.23.0
0.24.0
0.24.1
0.25.0
0.25.1
0.26.0
0.27.0
0.27.1
0.27.2
0.28.0
0.28.1
0.28.2
0.28.3
0.28.4
0.28.5
0.29.0
0.29.1
0.30.0
0.30.1
0.30.2
0.30.3
0.30.5
0.30.6
0.31.0
0.31.1
0.32.0
0.32.2
0.32.3
0.33.0
0.33.1
0.34.0
0.34.1
0.34.2
0.35.0
0.36.0
0.36.1
0.37.0
0.38.0
0.39.0
0.40.0
0.41.0
0.42.0
0.42.1
0.43.0
0.43.1
0.43.2
0.43.3
0.44.0
0.45.0
*** 0.46.0
0.5.0
0.6.0
0.6.1
0.7.0
0.8.0
0.8.1
0.9.0