Skip to content

Commit 42300b7

Browse files
committed
fix: switch to standalone
Also modernize & fix showcase app
1 parent 7aa6e3a commit 42300b7

File tree

93 files changed

+1886
-1328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1886
-1328
lines changed

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ v10.X : Angular 16 - 17
2424

2525
v11.X : Angular 18
2626

27+
(UNRELEASED) v12.X : Angular 19
28+
2729
Include the following components:
2830

2931
- [mgl-map](https://wykks.github.io/ngx-mapbox-gl/doc#mgl-map)
@@ -79,21 +81,22 @@ Or in the global CSS file (called `styles.css` for example in _angular-cli_):
7981
@import '~mapbox-gl/dist/mapbox-gl.css';
8082
```
8183

82-
Then, in your app's main module (or in any other module), import the `NgxMapboxGLModule`:
84+
Then, you can configure the access token this way:
85+
NOTE: This is optional, you can also set the access tokenper map (accessToken input of mgl-map)
8386

8487
```ts
8588
...
86-
import { NgxMapboxGLModule } from 'ngx-mapbox-gl';
87-
88-
@NgModule({
89-
imports: [
90-
...
91-
NgxMapboxGLModule.withConfig({
92-
accessToken: 'TOKEN', // Optional, can also be set per map (accessToken input of mgl-map)
93-
})
94-
]
95-
})
96-
export class AppModule {}
89+
import { ApplicationConfig } from '@angular/core';
90+
import { provideMapboxGL } from 'ngx-mapbox-gl';
91+
92+
export const appConfig: ApplicationConfig = {
93+
providers: [
94+
provideMapboxGL({
95+
accessToken: 'TOKEN'
96+
}),
97+
[...]
98+
]
99+
}
97100
```
98101

99102
How to get a Mapbox token: https://www.mapbox.com/help/how-access-tokens-work/
@@ -112,8 +115,7 @@ import { Component } from '@angular/core';
112115
[style]="'mapbox://styles/mapbox/streets-v9'"
113116
[zoom]="[9]"
114117
[center]="[-74.5, 40]"
115-
>
116-
</mgl-map>
118+
/>
117119
`,
118120
styles: [
119121
`

apps/showcase/project.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
"main": "apps/showcase/src/main.ts",
1616
"polyfills": "apps/showcase/src/polyfills.ts",
1717
"tsConfig": "apps/showcase/tsconfig.app.json",
18-
"assets": ["apps/showcase/src/favicon.ico", "apps/showcase/src/assets"],
18+
"assets": [
19+
{
20+
"glob": "**/*",
21+
"input": "apps/showcase/public"
22+
}
23+
],
1924
"styles": [
2025
"apps/showcase/src/styles.css",
2126
"prismjs/themes/prism-okaidia.css"

apps/showcase/public/favicon.ico

14.7 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)