@ohuoy/easymap 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +318 -290
- package/dist/example - /345/211/257/346/234/254/bundle.js" +318 -290
- package/dist/example - /345/211/257/346/234/254/index.html" +11 -11
- package/index.js +4 -0
- package/lib/threebox-plugin/CHANGELOG.md +665 -0
- package/lib/threebox-plugin/LICENSE.txt +97 -0
- package/lib/threebox-plugin/README.md +199 -0
- package/lib/threebox-plugin/exports.js +2 -0
- package/lib/threebox-plugin/main.js +8 -0
- package/lib/threebox-plugin/package.json +44 -0
- package/lib/threebox-plugin/server.stop.js +13 -0
- package/lib/threebox-plugin/src/Threebox.js +1216 -0
- package/lib/threebox-plugin/src/animation/AnimationManager.js +483 -0
- package/lib/threebox-plugin/src/camera/CameraSync.js +302 -0
- package/lib/threebox-plugin/src/objects/CSS2DRenderer.js +245 -0
- package/lib/threebox-plugin/src/objects/LabelRenderer.js +71 -0
- package/lib/threebox-plugin/src/objects/Object3D.js +34 -0
- package/lib/threebox-plugin/src/objects/effects/BuildingShadows.js +115 -0
- package/lib/threebox-plugin/src/objects/extrusion.js +61 -0
- package/lib/threebox-plugin/src/objects/fflate.min.js +15 -0
- package/lib/threebox-plugin/src/objects/label.js +29 -0
- package/lib/threebox-plugin/src/objects/line.js +1386 -0
- package/lib/threebox-plugin/src/objects/loadObj.js +142 -0
- package/lib/threebox-plugin/src/objects/loaders/ColladaLoader.js +3751 -0
- package/lib/threebox-plugin/src/objects/loaders/FBXLoader.js +3864 -0
- package/lib/threebox-plugin/src/objects/loaders/GLTFLoader.js +3857 -0
- package/lib/threebox-plugin/src/objects/loaders/MTLLoader.js +498 -0
- package/lib/threebox-plugin/src/objects/loaders/OBJLoader.js +818 -0
- package/lib/threebox-plugin/src/objects/objects.js +1113 -0
- package/lib/threebox-plugin/src/objects/sphere.js +28 -0
- package/lib/threebox-plugin/src/objects/tooltip.js +27 -0
- package/lib/threebox-plugin/src/objects/tube.js +35 -0
- package/lib/threebox-plugin/src/three.js +6 -0
- package/lib/threebox-plugin/src/three.module.js +54571 -0
- package/lib/threebox-plugin/src/utils/ValueGenerator.js +11 -0
- package/lib/threebox-plugin/src/utils/constants.js +21 -0
- package/lib/threebox-plugin/src/utils/material.js +52 -0
- package/lib/threebox-plugin/src/utils/suncalc.js +322 -0
- package/lib/threebox-plugin/src/utils/utils.js +424 -0
- package/lib/threebox-plugin/src/utils/validate.js +115 -0
- package/package.json +18 -18
- package/src/components/EasyMapMarker.js +8 -0
- package/src/components/control/DrawBar.js +5 -0
- package/src/components/control/TilesBar.js +116 -27
- package/src/components/control/Toobars.js +20 -1
- package/src/components/layer/AlarmLayer.js +4 -1
- package/src/components/layer/AnimationBarbsLayer.js +1 -1
- package/src/components/layer/AnimationLayer copy.js +1 -1
- package/src/components/layer/AnimationLayer.js +11 -3
- package/src/components/layer/CustomIconLayer.js +1 -1
- package/src/components/layer/ExtrusionLayer.js +1 -1
- package/src/components/layer/ExtrusionLayerold.js +2 -1
- package/src/components/layer/MarkerAreaLayer.js +1 -1
- package/src/components/layer/PathLineLayer.js +1 -1
- package/src/components/layer/ThreeScanLayer.js +51 -14
- package/src/components/layer/ThreeWallLayer.js +1 -1
- package/webpack.config.js +2 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
v.2.0.1 - v.2.2.6
|
|
2
|
+
MIT License
|
|
3
|
+
Copyright (c) 2020 Jesus Serrano
|
|
4
|
+
|
|
5
|
+
v.0.3.0
|
|
6
|
+
MIT License
|
|
7
|
+
Copyright (c) 2017 Peter Liu
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------------------------
|
|
28
|
+
SunCalc (c) 2011-2015, Vladimir Agafonkin
|
|
29
|
+
Copyright (c) 2014, Vladimir Agafonkin
|
|
30
|
+
All rights reserved.
|
|
31
|
+
|
|
32
|
+
Redistribution and use in source and binary forms, with or without modification, are
|
|
33
|
+
permitted provided that the following conditions are met:
|
|
34
|
+
|
|
35
|
+
1. Redistributions of source code must retain the above copyright notice, this list of
|
|
36
|
+
conditions and the following disclaimer.
|
|
37
|
+
|
|
38
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
39
|
+
of conditions and the following disclaimer in the documentation and/or other materials
|
|
40
|
+
provided with the distribution.
|
|
41
|
+
|
|
42
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
43
|
+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
44
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
45
|
+
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
46
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
47
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
48
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
49
|
+
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
50
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
51
|
+
|
|
52
|
+
---------------------------------------------------------------------------------------------
|
|
53
|
+
3D models attributions
|
|
54
|
+
|
|
55
|
+
- Eiffel Tower
|
|
56
|
+
- Creative Commons License attribution: Eiffel Tower model by https://www.cgtrader.com/lefabshop
|
|
57
|
+
from https://www.cgtrader.com/items/108594/download-page
|
|
58
|
+
|
|
59
|
+
- Elephant
|
|
60
|
+
- Creative Commons NonCommercial License attribution: Asian Elephant low poly model by https://sketchfab.com/jeremielouvetz
|
|
61
|
+
from https://sketchfab.com/3d-models/asian-elephant-2aeeb8958bc64240962b093705abffdf
|
|
62
|
+
|
|
63
|
+
- Liberty Statue
|
|
64
|
+
- Creative Commons License attribution: Liberty statue model by https://sketchfab.com/hellolucy2
|
|
65
|
+
from https://sketchfab.com/3d-models/ellis-island-3cd765a23c5c4c7087acd00624d30590
|
|
66
|
+
|
|
67
|
+
- Plane
|
|
68
|
+
- Creative Commons License attribution: Plane model by https://sketchfab.com/ideehochzwei
|
|
69
|
+
from https://sketchfab.com/3d-models/plane-aa001f5a88f64b16b98356c042f2d5f3
|
|
70
|
+
|
|
71
|
+
- Radar
|
|
72
|
+
- Attribution, no License specified: Model by https://github.com/nasa/
|
|
73
|
+
from https://nasa3d.arc.nasa.gov/detail/jpl-vtad-dsn34
|
|
74
|
+
|
|
75
|
+
- Soldier
|
|
76
|
+
- Attribution: Soldier animated model by T. Choonyung at https://www.mixamo.com
|
|
77
|
+
from https://www.mixamo.com/#/?page=1&query=vanguard&type=Character
|
|
78
|
+
|
|
79
|
+
- Space Needle
|
|
80
|
+
- Creative Commons License attribution: Space Needle model by https://sketchfab.com/microsoft
|
|
81
|
+
from https://sketchfab.com/3d-models/space-needle-1d1325bc1ad745dd9eb34fc76e8f6e87
|
|
82
|
+
|
|
83
|
+
- Triceratops
|
|
84
|
+
- Creative Commons NonCommercial License attribution: Dino low poly model by https://sketchfab.com/Blender_Fox1234
|
|
85
|
+
from https://sketchfab.com/3d-models/triceratops-lowpoly-76beb95d0b5b41a3aae0d07c3eae99fa
|
|
86
|
+
|
|
87
|
+
- Truck & Car
|
|
88
|
+
- Royalty Free License: Vehicles by https://www.cgtrader.com/antonmoek
|
|
89
|
+
from https://www.cgtrader.com/free-3d-models/car/concept/cartoon-low-poly-city-cars-pack
|
|
90
|
+
|
|
91
|
+
- Windmill
|
|
92
|
+
- Creative Commons License attribution: Windmill animated model by https://sketchfab.com/data3anshow
|
|
93
|
+
from https://sketchfab.com/3d-models/windmill-animated-6ce5667e8d5c47068ea13196036efd52
|
|
94
|
+
|
|
95
|
+
- Glacier d'Argentiere
|
|
96
|
+
- Attribution, no License specified: Glacier model by https://github.com/jbbarre
|
|
97
|
+
from https://github.com/jbbarre/glacierargentiere/blob/main/data/glacier_wgs.gltf
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# `Threebox`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
[](https://github.com/jscastro76/threebox/releases/)
|
|
6
|
+
[](https://www.npmjs.org/package/threebox-plugin)
|
|
7
|
+
[](https://www.npmjs.org/package/threebox-plugin)
|
|
8
|
+
|
|
9
|
+
A **[*Three.js*](https://threejs.org/)** plugin for **[*Mapbox GL JS*](https://docs.mapbox.com/mapbox-gl-js/examples/)** and **[*Azure Maps*](https://azure.microsoft.com/en-us/services/azure-maps/)** using the [`CustomLayerInterface`](https://docs.mapbox.com/mapbox-gl-js/api/properties/#customlayerinterface) feature. Provides convenient methods to manage objects in lnglat coordinates, and to synchronize the map and scene cameras.
|
|
10
|
+
<img alt="threebox" src="docs/gallery.jpg">
|
|
11
|
+
|
|
12
|
+
<br>
|
|
13
|
+
|
|
14
|
+
- - -
|
|
15
|
+
## Latest release
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
Latest **code release** is [](https://github.com/jscastro76/threebox/releases/), please review the [**Change log**](https://github.com/jscastro76/threebox/blob/master/CHANGELOG.md) for more details.
|
|
19
|
+
|
|
20
|
+
Threebox is also available as an **nmp package** [](https://www.npmjs.org/package/threebox-plugin)
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
npm i threebox-plugin
|
|
24
|
+
```
|
|
25
|
+
<br>
|
|
26
|
+
|
|
27
|
+
- - -
|
|
28
|
+
|
|
29
|
+
## ONLY in this Threebox fork
|
|
30
|
+
|
|
31
|
+
|Models built-in & custom animations |Mouse over/out, Selected, Drag&Drop, Drag&Rotate, Wireframe
|
|
32
|
+
|---------|-----------------------
|
|
33
|
+
|<img alt="threebox" src="https://i.postimg.cc/vTNLLLLn/Animation-Video.gif" width="100%">|<img alt="threebox" src="https://i.postimg.cc/3Jjgnvjz/Wireframes.gif" width="100%" >
|
|
34
|
+
|
|
35
|
+
|Tooltips using altitude|Optimization of camera perspective and depth
|
|
36
|
+
|----------|-------
|
|
37
|
+
|<img alt="threebox" src="https://i.postimg.cc/wM7DvR8j/Labels-On-Height.gif" width="100%">|<img alt="threebox" src="https://i.postimg.cc/zB9nPwcY/Depth.gif" width="100%">
|
|
38
|
+
|
|
39
|
+
|Runtime style change|Optimized performance through cache
|
|
40
|
+
|----------|-------
|
|
41
|
+
|<img alt="threebox" src="https://i.postimg.cc/QMh57yGP/Style-Change.gif" width="100%">|<img alt="threebox" src="https://i.postimg.cc/zf2wTYwB/Performance.gif" width="100%">
|
|
42
|
+
|
|
43
|
+
|Customizable FOV|Geojson and Points Extrusions
|
|
44
|
+
|---------|-------
|
|
45
|
+
|<img alt="threebox" src="https://i.postimg.cc/43Lh7vvR/Customizable-FOV.gif" width="100%">|<img alt="threebox" src="https://i.postimg.cc/50KqJdKv/extrusions.gif" width="100%">
|
|
46
|
+
|
|
47
|
+
|Sunlight illumination for a given datetime and lnglat|Models built-in shadows and sky layer synced with Sunlight
|
|
48
|
+
|---------|-------
|
|
49
|
+
|<img alt="threebox" src="https://i.postimg.cc/6QnjWSVm/Eiffel-Shadow.gif" width="100%">|<img alt="threebox" src="https://i.postimg.cc/63Y7SP6t/SunSki.gif" width="100%">
|
|
50
|
+
|
|
51
|
+
<br>
|
|
52
|
+
|
|
53
|
+
Only in this fork, there is a list of new features implemented on top of the amazing work from [@peterqliu](https://github.com/peterqliu/threebox/):
|
|
54
|
+
- Updated to [**Three.js r132**](https://github.com/mrdoob/three.js/releases/tag/r132).
|
|
55
|
+
- Updated to **Mapbox-gl-js v2.2.0**.
|
|
56
|
+
- Updated to **Azure Maps v2.0.31**.
|
|
57
|
+
- [+20 examples](https://github.com/jscastro76/threebox/tree/master/examples) with all the new features.
|
|
58
|
+
- Support for multiple 3D format objects (FBX, GLTF/GLB, Collada, OBJ/MTL).
|
|
59
|
+
- Support for 3D extruded shapes from [GeoJson](https://geojson.org/) features or points array.
|
|
60
|
+
- Support for CSS2D labels and rich HTML controls through a new LabelManager.
|
|
61
|
+
- Support for CSS2D tooltips/title browser-like and mapbox-like.
|
|
62
|
+
- Support for built-in Raycaster in Object3D and fill-extrusions together.
|
|
63
|
+
- Support for built-in MouseOver/Mouseout, Selected, Drag&Drop, Drag&Rotate, Wireframe in loadedObjects including events.
|
|
64
|
+
- Support for wireframing on any Object3D, removing them from the Raycaster.
|
|
65
|
+
- Support for [GeoJson](https://geojson.org/) standard features format import and export in different layers.
|
|
66
|
+
- Support for Object3D embedded animations, and custom animations on AnimationManager (i.e. embedded animation + translate + rotate).
|
|
67
|
+
- Support for multi-layer and multi-floor design of spaces.
|
|
68
|
+
- Support for built-in shadows and real Sun light positioning for a given datetime and lnglat coords.
|
|
69
|
+
- Support for built-in Mapbox v2 Sky and Terrain layer synced with real Sun light.
|
|
70
|
+
- Support for Non-AABB Non Axes Aligned Bounding Box and real model size, including floor projection.
|
|
71
|
+
- Support for Object3D auto-centering and 9 default anchor positions customizable through adjustments.
|
|
72
|
+
- Support for `setLayerZoomRange` and `setLayoutProperty` on Custom Layers (not available in Mapbox).
|
|
73
|
+
- Support for `removeLayer` considering Object3D.
|
|
74
|
+
- Support for style change through `setStyle` and keeping Object3D.
|
|
75
|
+
- Support for partial and full dispose of Mapbox, Three and Threebox resources and memory.
|
|
76
|
+
- Support for Orthographic view, customizable Perspective FOV and fixed-size Object3D.
|
|
77
|
+
- Optimization of Camera perspective to have Raycast with pixel-precision level and depth sync between Mapbox and Threebox objects.
|
|
78
|
+
- Optimization for loading thousands of objects through cache.
|
|
79
|
+
- Available as [npm package](https://www.npmjs.com/package/threebox-plugin)
|
|
80
|
+
- Check out [change log](https://github.com/jscastro76/threebox/blob/master/CHANGELOG.md) for more detail.
|
|
81
|
+
|
|
82
|
+
<br>
|
|
83
|
+
|
|
84
|
+
- - -
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Documentation
|
|
88
|
+
<img alt="threebox" src="docs/soldieranimation.jpg">
|
|
89
|
+
|
|
90
|
+
All the [**Threebox Documentation**](/docs/Threebox.md) has been completely updated, including all the methods, properties and events implemented in Threebox and objects, but still *'work in progress'* adding better documented examples and images to illustrate Threebox capabilities.
|
|
91
|
+
- [**Using Threebox**](/docs/Threebox.md#using-threebox)
|
|
92
|
+
- [**Loading a 3D Model**](/docs/Threebox.md#loading-a-3d-model)
|
|
93
|
+
- [**Threebox methods**](/docs/Threebox.md#threebox-methods)
|
|
94
|
+
- [**Object methods**](/docs/Threebox.md#object-methods)
|
|
95
|
+
- [**Examples**](/examples/README.md)
|
|
96
|
+
|
|
97
|
+
<br>
|
|
98
|
+
|
|
99
|
+
- - -
|
|
100
|
+
|
|
101
|
+
## Compatibility/Dependencies
|
|
102
|
+
|
|
103
|
+
- [**Three.js 132**](https://github.com/mrdoob/three.js/releases/tag/r132). (already bundled into the Threebox build). If desired, other versions can be swapped in and rebuilt [here](https://github.com/jscastro76/threebox/blob/master/src/three.js), though compatibility is not guaranteed.
|
|
104
|
+
- **Mapbox-gl-js v1.11.1. or v.2.0.1**. **Warning**: Despite v1.11.1 still supported, if used, some features from mapbox v.2.0.1 won't be obviously available such as sky layers.
|
|
105
|
+
- **Azure Maps v2.0.31.**
|
|
106
|
+
|
|
107
|
+
<br>
|
|
108
|
+
|
|
109
|
+
- - -
|
|
110
|
+
|
|
111
|
+
## Getting started
|
|
112
|
+
|
|
113
|
+
You can use threebox in three different ways.
|
|
114
|
+
|
|
115
|
+
#### NPM install
|
|
116
|
+
Add threebox to your project via **npm package** [](https://www.npmjs.org/package/threebox-plugin) :
|
|
117
|
+
```js
|
|
118
|
+
npm install threebox-plugin
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Then you will need to import Threebox object in your code. Depending your javascript framework this might be different.
|
|
122
|
+
```js
|
|
123
|
+
import { Threebox } from 'threebox-plugin';
|
|
124
|
+
```
|
|
125
|
+
Depending the framework, wrapper or bundler you ar using, try with this:
|
|
126
|
+
```js
|
|
127
|
+
import { Threebox } from 'threebox-plugin/dist/threebox';
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
<br/>
|
|
131
|
+
|
|
132
|
+
#### Use the bundle locally
|
|
133
|
+
Download the bundle from [`dist/threebox.js`](dist/threebox.js) or [`dist/threebox.min.js`](dist/threebox.min.js) and include it in a `<script>` tag on your page.
|
|
134
|
+
If you want to use styles predefined, add the link to the cascade style sheet, just ensure the `src` and `href` attributes are pointing to relative or absolute url path.
|
|
135
|
+
```html
|
|
136
|
+
<script src="../dist/threebox.js" type="text/javascript"></script>
|
|
137
|
+
<link href="../dist/threebox.css" rel="stylesheet" />
|
|
138
|
+
```
|
|
139
|
+
<br/>
|
|
140
|
+
|
|
141
|
+
#### Public CDNs
|
|
142
|
+
Threebox can be also used from different public CDNs:
|
|
143
|
+
|
|
144
|
+
##### jsdelivr
|
|
145
|
+
This CDN has the particularity that always requires the version of the package to download individual files.
|
|
146
|
+
```html
|
|
147
|
+
<script src="https://cdn.jsdelivr.net/gh/jscastro76/threebox@v.2.2.2/dist/threebox.min.js" type="text/javascript"></script>
|
|
148
|
+
<link href="https://cdn.jsdelivr.net/gh/jscastro76/threebox@v.2.2.2/dist/threebox.css" rel="stylesheet" />
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
<br/>
|
|
152
|
+
|
|
153
|
+
##### unpkg
|
|
154
|
+
Despite this CDN admits version, if omitted, it will download always the last one published.
|
|
155
|
+
|
|
156
|
+
```html
|
|
157
|
+
<script src="https://unpkg.com/threebox-plugin/dist/threebox.min.js" type="text/javascript"></script>
|
|
158
|
+
<link href="https://unpkg.com/threebox-plugin/dist/threebox.css" rel="stylesheet" />
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
For an specific version (i.e. v2.2.1) use the followin:
|
|
162
|
+
```html
|
|
163
|
+
<script src="https://unpkg.com/threebox-plugin@2.2.1/dist/threebox.min.js" type="text/javascript"></script>
|
|
164
|
+
<link href="https://unpkg.com/threebox-plugin@2.2.1/dist/threebox.css" rel="stylesheet" />
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
<br/>
|
|
168
|
+
|
|
169
|
+
#### Test the samples
|
|
170
|
+
Several introductory examples are [here](https://github.com/jscastro76/threebox/tree/master/examples).
|
|
171
|
+
To run them, create a `config.js` file with your Mapbox-gl-js access token, alongside and in the format of [the template](https://github.com/jscastro76/threebox/blob/master/examples/config_template.js).
|
|
172
|
+
|
|
173
|
+
<br>
|
|
174
|
+
|
|
175
|
+
- - -
|
|
176
|
+
|
|
177
|
+
## Contributing
|
|
178
|
+
- Clone the [Github repo](https://github.com/jscastro76/threebox/).
|
|
179
|
+
- Build the library with `npm run build` to get the minimized version, or `npm run dev` to get the development version and rebuild continuously as you develop.
|
|
180
|
+
- Both commands will output a bundle in [`dist/`](dist/) folder.
|
|
181
|
+
|
|
182
|
+
#### Unit tests
|
|
183
|
+
Tests live [here](/tests).
|
|
184
|
+
- Build first the test bundle with `npm run test`, this will create [`tests\threebox-tests-bundle.js`](tests/threebox-tests-bundle.js)
|
|
185
|
+
- Then in your preferred browser navigate to [`threebox-tests.html`](https://github.com/jscastro76/threebox/blob/master/tests/threebox-tests.html) and check the console for test results.
|
|
186
|
+
|
|
187
|
+
#### How to build the project in Visual Studio
|
|
188
|
+
Sample to get a full build from scratch for Visual Studio:
|
|
189
|
+
- Install [Node.js](https://nodejs.org/en/)
|
|
190
|
+
- Clone the repo and open a new Project using main.js
|
|
191
|
+
- Install / Update the packages browserify, tape, ncp, uglyfy, watchify.
|
|
192
|
+
- Right click on the project at the Solution Explorer > Open Node.js Interactive Window:
|
|
193
|
+
- execute `.npm [ProjectName] init -y`
|
|
194
|
+
- execute `.npm [ProjectName] install`
|
|
195
|
+
- execute `.npm [ProjectName] i`
|
|
196
|
+
- execute `.npm [ProjectName] run dev` or `.npm run build
|
|
197
|
+
`
|
|
198
|
+
|
|
199
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "threebox-plugin",
|
|
3
|
+
"version": "2.2.7",
|
|
4
|
+
"description": "A Three.js plugin for Mapbox GL JS, using the CustomLayerInterface feature. Provides convenient methods to manage objects in lnglat coordinates, and to synchronize the map and scene cameras.",
|
|
5
|
+
"main": "main.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jscastro76/threebox.git"
|
|
9
|
+
},
|
|
10
|
+
"author": " @jscastro76, @peterqliu, @kronick",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/jscastro76/threebox/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/jscastro76/threebox#readme",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "browserify -p tinyify exports.js > dist/threebox.min.js && ncp ./examples/css/threebox.css ./dist/threebox.css --stopOnErr",
|
|
18
|
+
"dev": "watchify exports.js --verbose -o dist/threebox.js ",
|
|
19
|
+
"all": "browserify -p tinyify exports.js > dist/threebox.min.js && watchify exports.js --verbose -o dist/threebox.js ",
|
|
20
|
+
"test": "browserify tests/threebox-tests.js > tests/threebox-tests-bundle.js",
|
|
21
|
+
"start": "node server.js",
|
|
22
|
+
"stop": "node server.stop.js"
|
|
23
|
+
},
|
|
24
|
+
"directories": {
|
|
25
|
+
"doc": "docs",
|
|
26
|
+
"example": "examples",
|
|
27
|
+
"test": "tests"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"browserify": "^17.0.0",
|
|
31
|
+
"ncp": "^2.0.0",
|
|
32
|
+
"tape": "^5.1.1",
|
|
33
|
+
"tinyify": "^3.0.0",
|
|
34
|
+
"uglifyify": "^5.0.2",
|
|
35
|
+
"watchify": "^4.0.0"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"three.js",
|
|
39
|
+
"mapbox",
|
|
40
|
+
"mapbox-gl-js",
|
|
41
|
+
"azure-maps",
|
|
42
|
+
"3D"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var port = 8080 || process.env.PORT || 1337;
|
|
3
|
+
|
|
4
|
+
const io = require('socket.io-client');
|
|
5
|
+
const socketClient = io.connect('http://localhost' + port); // Specify port if your express server is not using default port 80
|
|
6
|
+
|
|
7
|
+
socketClient.on('connect', () => {
|
|
8
|
+
socketClient.emit('npmStop');
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
process.exit(0);
|
|
11
|
+
}, 1000);
|
|
12
|
+
});
|
|
13
|
+
|