A quick way to start a web map application with Angular using MapLibre GL JS.
A simple fullscreen map application is used to showcase how to utilize MapTiler maps together with Angular and MapLibre GL JS for your Angular app.
Documentation: How to display a map in Angular using MapLibre GL JS
Online demo: https://labs.maptiler.com/angular-template-maplibre-gl-js/
This project was generated with Angular CLI version 13.0.2.
- npm
npm install npm@latest -g
- Angular CLI
npm install -g @angular/cli
Clone the repo to create a new angular project. Run in your command-line:
git clone https://github.com/maptiler/angular-template-maplibre-gl-js.git my-angular-map
Navigate to the newly created project folder my-angular-map
Install the NPM packages dependencies. Run in your command-line:
npm install
Navigate to the src/environments
folder
Open the environment.ts
and environment.prod.ts
file,
Your MapTiler account access key is on your MapTiler Cloud account page.
ℹ️ If you don't have an API KEY, you can create it for free at https://www.maptiler.com/cloud/
To start your local environment, run:
ng serve --open
You will find your app on address http://localhost:4200/.
Now you should see the app in your browser.
To build for production, run:
ng build --base-href /angular-template-maplibre-gl-js/
To deploy the app to the gh-pages branch, run:
node gh-pages.js
Distributed under the MIT License. See LICENSE
for more information.
Instead of using or developing a custom map component, you can use the Angular binding of maplibre-gl-js (ngx-maplibre-gl).
Checkout to Get started with Angular and MapLibre GL JS repo to use de ngx-maplibre-gl component.