Q: How to connect Three.js with any GIS map and place/process .JS (important .js) object there?
Description:
I have an app with .js model and 3D mesh model (tiles), now I need to retrieve the attributive information of the map (3D mesh) objects where ray intersects, e. I.: this is water, this is forest.
I got an idea to connect any open map and retrieve the information from there by layers (water layer, forest layer).
So far I found threebox + mapbox-gl to connect OpenStreetMap (seems like the one solution). But I cannot place the .js object. Moreover, there are two instances of three.js in the project (one is mine and one from threebox). Can anyone explain how to:
- Use just one Three.js instance?
- Place JS object in map?
- Move object in map (in my own app I have manipulators, but seems like they won't work)?
Would be nice to hear @jscastro
No result:
tb.loadObj({
obj: 'projects/testProject/model/js/test.js',
type: 'custom',
scale: 1, /* same for 1000000000 */
units: 'meters',
rotation: { x: 90, y: 177, z: 0 },
anchor: 'auto'
}, function (model) {
console.log(model)
model.setCoords([25.2826859, 54.6718792, 1280]);
model.addTooltip("Blabla", true);
model.color = 0xffffff;
//model.selected = true;
tb.add(model);
})
up: no problem with loading .js in own app.