peterqliu / threebox

A three.js plugin for Mapbox GL JS, with support for basic animation and advanced 3D rendering.
MIT License
522 stars 315 forks source link

vue import error: #93

Open luojiandan opened 3 years ago

luojiandan commented 3 years ago

@peterqliu @kronick @McCulloughRT Hi,I need u help:) I import threebox to my project,get error:(,what's wrong? image image image

the threebox.js in static folder,it's ok: image

luojiandan commented 3 years ago

import image

jscastro76 commented 3 years ago

If that´s your only html, you are missing the required links to mapbox script and css

    <script src="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js"></script>
    <link href="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.css" rel="stylesheet" />

Threebox is a Three.js plugin for Mapbox, Three.js is embedded, but not Mapbox, you need to add it to your project or the link to their js + css

luojiandan commented 3 years ago

@jscastro76 thanks your replay:) I work in Vue

Vue:2.5.2 Mapbox-GL:1.12.0 threebox:2.0.4 image image

luojiandan commented 3 years ago

@jscastro76 Example repo:https://github.com/luojiandan/VueMapboxThreebox

jscastro76 commented 3 years ago

Solved in this fork