Comments (2)
Hi!
You can't pass the ref of the component as input (I could make it work like that, let me think about that 😃 ).
Change [source]="canvasSource"
(whitch refer to #canvasSource
) to source="canvasSource"
(which refer to id='canvasSource'
).
Same for [canvas]='mycanvas'
=> canvas="mycanvas"
from ngx-mapbox-gl.
My bad, I thought source and canvas are input. It's working, thank you.
Yesterday I able to make it work by binding the event to component.
mapLoaded(event) {
this.map = event;
//add source
this.map.addSource('canvasSource', {
type: 'canvas',
canvas: 'mycanvas',
coordinates: [
[-81.490, 46.437],
[-72.582, 46.437],
[-72.582, 38.907],
[-81.490, 38.907]
]
});
//add layer
this.map.addLayer({
id: 'canvasLayer',
source: 'canvasSource',
type: 'raster',
paint: { 'raster-opacity': 0.85 }
});
}
from ngx-mapbox-gl.
Related Issues (20)
- Extend `MapImageOptions` for stretchable images
- Angular v15 HOT 2
- Cannot set property config HOT 1
- Zoom in/out moves marker
- Rxjs 7.5.6?
- So, this library will not going to upgrade to Angular v15, right? HOT 3
- Fit the map between two points with two world map connected
- Demo site is broken HOT 3
- Is the project upgraded to angular 16? HOT 5
- Imports are immutable in JavaScript - esbuild error HOT 3
- mapCreate doesn't fire HOT 5
- Using mapbox cdn or other means of excluding mapbox from main bundle
- RTL support HOT 2
- Cannot assign to import "baseApiUrl" HOT 3
- The cursorStyle is not having any effect on the page.
- Angular 17 Support? HOT 8
- mgl-markers-for-clusters not rendering properly on lazy loaded routing
- mapbox-gl conflicting peer dependency HOT 1
- Module not found: Can't resolve 'mapbox-gl' https://nextjs.org/docs/messages/module-not-found
- how to re render mgl-markers-for-cluster
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-mapbox-gl.