does not work with aframe 1.0.4
sehadnassim opened this issue · 8 comments
here is a glitch file : https://glitch.com/~seed-uncovered-phone
as if you test examples/gps/index.html it works well with aframe 0.8.2 but the position on the map does not change with aframe 1.0.4
thanks, i will look at it this weekend.
thanks, i will look at it this weekend.
Any updates on this ? Thanks
hi,
there was some change in the handling custom canvas material between 0.8 and 1.0.4
See here however the issue lacks of detailed descriptions.
The official examples show that the canvas must be create in the a-assets container, however mapbox GL API
creates automatically the canvas for you... so there could be the problem as well.
i am not sure why it does not update the canvas element, after calling needsUpdate=true
on the Material...
sorry for the moment, but i will investigate further a little bit later
- I did a quick test an inserted this line log:
console.log('[mapbox] position',position)
- In Line 39 of index.html for the gps demo
- The position returned (lnglat) was correct to my local GPS
- So the issue seems to be with the
project
function in newer version of A-Frame
thanks @kfarr for the investigation.
i don't think that the problem lies in the project function but rather in the update of the canvas material. it's just not refreshing the content of the canvas.
you can test this if you update the mapbox component attributes aftwards like setting the zoom or the center. the canvas just does not get refresehed and i have no idea why...
By adding this component into a-mapbox, I could see the issue was fixed. But on oculus quest 2, it is displaying blank white plane.
Can you check the reason?
AFRAME.registerComponent('canvas-updater', {
dependencies: ['geometry', 'material'],
tick: function () {
const el = this.el;
let material;
material = el.getObject3D('mesh').material;
if (!material.map) { return; }
material.map.needsUpdate = true;
}
});
should be fixed with new version 4.0.1 . The material was updated to early for the canvas to be reflected.
@superchao417 you do not need this canvas-updated anymore.