Comments (11)
You need to install types/geojson, I think.
This will be solved in next release, but until then I believe this is the right solution.
from ngx-maplibre-gl.
I've updated the readme, and partially the API.md.
If you have a few minutes to spare to send a PR for updating the API.md links to point to maplibre documentation instead of mapbox documentation it would be extremely helpful :-)
from ngx-maplibre-gl.
You can check the code in the demo (documentation) pages to see working examples in stack blitz that uses angular.
from ngx-maplibre-gl.
Feel free to send any PR to update the documentation :-)
from ngx-maplibre-gl.
You need to install types/geojson, I think.
This will be solved in next release, but until then I believe this is the right solution.
Thanks, and yes, that solved the error message.
You can check the code in the demo (documentation) pages to see working examples in stack blitz that uses angular.
Would you be so kind and provide a link to the demo (documentation) you are talking about? I simply cannot find anything helpful.
(If you mean the documentation from the Readme file ... as I mentioned above, that did not work for me ;o)
Thank you VERY MUCH, also for the super fast replies.
Cheers
from ngx-maplibre-gl.
No problem, can I close this issue or do you think something should be added somewhere?
The documentation is here:
https://maplibre.org/ngx-maplibre-gl/
I'll update the readme to link there.
from ngx-maplibre-gl.
No problem, can I close this issue or do you think something should be added somewhere?
The documentation is here:
https://maplibre.org/ngx-maplibre-gl/
I'll update the readme to link there.
Thanks again for all your help and efforts.
I would like to mention that my problem is fixed meanwhile, but unfortunately it still exists, although I followed all the provided documentation.
This is what I did:
- Created a fresh, blank and default Angular project
- Executed: npm install ngx-maplibre-gl maplibre-gl @types/geojson
- Modified the project files as shown in the documentation and demo.
The related files are then looking like this:
angular.json
...
"styles": [
"src/styles.css",
"./node_modules/maplibre-gl/dist/maplibre-gl.css"
],
...
polyfills.ts
...
(window as any).global = window;
...
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NgxMapLibreGLModule } from 'ngx-maplibre-gl';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
NgxMapLibreGLModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.ts
import { Component } from '@angular/core';
@Component({
template: `
<mgl-map
[style]="'https://api.maptiler.com/maps/streets/style.json?key=MyOwnValidKey'"
[zoom]="[9]"
[center]="[-74.50, 40]"
>
</mgl-map>
`,
styles: [
`
mgl-map {
height: 100%;
width: 100%;
}
`,
],
})
export class AppComponent {}
The code succesfully compiles but the preview window still remains just white without a map.
What am I missing here?
Any help would be really appreciated.
Thanks again in advance.
from ngx-maplibre-gl.
You need a style and tiles source I guess...?
Please share the relevant code and I might be able to help...
from ngx-maplibre-gl.
The style source is given here in the app.component.ts:
[style]="'https://api.maptiler.com/maps/streets/style.json?key=MyOwnValidKey'"
Where to provide the vector tiles source? Cannot find this in the docu.
from ngx-maplibre-gl.
This is less related to this project.
This project only wraps maplibre. You should consult their documentation for style and tile sources. Note that version 2 is still in pre release and should not be used.
You can use the demotiles repo or get a key from maptiler.
from ngx-maplibre-gl.
Closing...
from ngx-maplibre-gl.
Related Issues (20)
- v15 breaks popups with [closeOnClick]="true" HOT 19
- Map does not render at full height HOT 7
- Add support for standalone components HOT 1
- Use the new SVG for MapLibre HOT 3
- runtime error HOT 2
- HTML Cluster HOT 2
- Sending lngLat changes to a marker before mapCreated has been fired causes crash HOT 7
- npm package for version 13.0.0 HOT 1
- Migrate e2e tests out of protractor
- Makes other libs crash like ag-grid HOT 1
- Change links to maplibre docs
- Controls created with the included directives aren't destroyed correctly HOT 1
- Try to display clusters on the map following your example but they don't appear HOT 3
- Angular 15 support HOT 28
- Help: MapKit JS integration with this Library HOT 4
- bearing attribute not working on Map?
- Map does not fill its container -- how to force a resize? HOT 5
- Map Component in <div> not displaying map HOT 2
- Showcase website gets unresponsive HOT 1
- Browser window resizing brakes map rendering HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-maplibre-gl.