I added a few methods to three-orbit-controls to be able to manually define phi or theta and be able to rotate to a given point.
// rotation in Y
controls.setAzimuthalAngle(theta);
// rotation in X
controls.setPolarAngle(phi);
I added a few methods to three-orbit-controls to be able to manually define phi or theta and be able to rotate to a given point.
// rotation in Y
controls.setAzimuthalAngle(theta);
// rotation in X
controls.setPolarAngle(phi);
| /** | |
| * Converts a XYZ vector3 to longitude latitude (Direct Polar) | |
| * @param Lng longitude | |
| * @param Lat latitude | |
| * @param Vector3 optional output vector3 | |
| * @returns a unit vector of the 3d position | |
| */ | |
| function lonLatToVector3 ( lng, lat, out ) { | |
| out = out || new THREE.Vector3(); |
| var p1={ | |
| x:0, | |
| y:0 | |
| }; | |
| var p2={ | |
| x:0, | |
| y:1 | |
| }; |
| var p1 = { | |
| x: 20, | |
| y: 20 | |
| }; | |
| var p2 = { | |
| x: 40, | |
| y: 40 | |
| }; |
| // Source: https://github.com/iTowns/itowns | |
| // Fork: https://github.com/sermonis/three-globe-map-itowns | |
| /* globals window */ | |
| import * as THREE from 'three'; | |
| import AnimationPlayer, { Animation } from 'Core/AnimationPlayer'; | |
| import Coordinates, { ellipsoidSizes } from 'Core/Geographic/Coordinates'; | |
| import CameraUtils from 'Utils/CameraUtils'; | |
| import StateControl from 'Controls/StateControl'; |
| var config = { | |
| type: Phaser.AUTO, | |
| width: 800, | |
| height: 600, | |
| backgroundColor: '#2d2d2d', | |
| parent: 'phaser-example', | |
| scene: { | |
| preload: preload, | |
| create: create, | |
| update: update |
Expose the Content-Disposition header using the Access-Control-Expose-Headers header and set
the Content-Disposition header as you would usually.
Access-Control-Expose-Headers: Content-Disposition
Content-Disposition: attachment; filename="example-file.csv"
| var log = require('cllc')(); | |
| var tress = require('tress'); | |
| var needle = require('needle'); | |
| var cheerio = require('cheerio'); | |
| var fs = require('fs'); | |
| var sCookie = 'http://www.puntolis.it/storelocator/defaultsearch.aspx?idcustomer=111'; | |
| var sProv = 'http://www.puntolis.it/storelocator/buildMenuProv.ashx?CodSer=111'; | |
| var sLoc = 'http://www.puntolis.it/storelocator/buildMenuLoc.ashx?CodSer=111&ProvSel=%s'; | |
| var sMarker = 'http://www.puntolis.it/storelocator/Result.aspx?provincia=%s&localita=%s&cap=XXXXX&Servizio=111'; |
Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.
This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.
UPD: This manual now compatible with nuxt@2.3. For older versions deployment, see revision history.
Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:
| module.exports = { | |
| /* | |
| Headers of the page | |
| - Nuxt.js uses vue-meta to update the headers and html attributes of your application. | |
| - Nuxt.js configures vue-meta with these options: | |
| { | |
| keyName: 'head', // the component option name that vue-meta looks for meta info on. | |
| attribute: 'data-n-head', // the attribute name vue-meta adds to the tags it observes | |
| ssrAttribute: 'data-n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered | |
| tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag |