New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate MapboxLayer in favor of MapboxOverlay #8584
Comments
@HarelM TIL - the deckgl data layers go in through the addControl, so it's used for more than html elements. I tried this overlay in a local MapLibre app with large deckgl IconLayers where I drag the viewport around really fast, and setting the |
Well, |
@HarelM , I think everyone involved are well aware, and supportive of, the need for a separate api with the ongoing divergence. |
Oh, I see, that's great to hear! Keep up the good work! |
I figured out how to get v9 to work. I'll update the samples. Here are the main changes:
Here are some code blocks: class DeckGLOverlay {
constructor(options) {
this.id = options.id;
// Create an instance of deck.gl MapboxOverlay what is compatible with Azure Maps
// https://deck.gl/docs/api-reference/mapbox/mapbox-overlay
this._mbOverlay = new deck.MapboxOverlay(options);
}
onAdd(map, options) {
this.map = map;
return this._mbOverlay.onAdd(map["map"]);
}
onRemove() {
this._mbOverlay.onRemove();
}
getCanvas() {
this._mbOverlay.getCanvas();
}
getId() {
return this.id;
}
pickObject(params) {
return this._mbOverlay.pickObject(params);
}
pickMultipleObjects(params) {
return this._mbOverlay.pickMultipleObjects(params);
}
pickObjects(params) {
return this._mbOverlay.pickObjects();
}
setProps(props) {
this._mbOverlay.setProps(props);
}
finalize() {
this._mbOverlay.finalize();
}
} map.controls.add(new DeckGLOverlay({
layers: [
new deck.ArcLayer({
id: "arc",
data: calculateArcs(features),
getSourcePosition: (d) => d.source,
getTargetPosition: (d) => d.target,
getSourceColor: [255, 0, 0],
getTargetColor: [0, 255, 0],
getWidth: 2
})
]
})); |
MapboxOverlay
supports the same features asMapboxLayer
and is more aligned with our other basemap integrations. Migration should be straightforward.Examples of the migration:
The text was updated successfully, but these errors were encountered: