Comparing version 0.1.19 to 0.1.21
@@ -1,1 +0,1 @@ | ||
function a(b){this.options=d.deepMerge(a.options,b)}function b(c){var b,d=this.lensFlares.length,a,e=-this.positionScreen.x*2,f=-this.positionScreen.y*2,g=c.size?c.size:35e6,i=h.camera,j=i.position.length();for(b=0;b<d;b++)a=this.lensFlares[b],a.x=this.positionScreen.x+e*a.distance,a.y=this.positionScreen.y+f*a.distance,a.scale=g/j,a.rotation=0}var c=require('three'),d=require('./../core/utils'),e=d.requestAnimationFrame,f=require('eventproxy'),g=require('./addons/lensflare_base64'),h;a.options={ambient:{color:'#fff',intensity:.5},spot:{color:'#333',intensity:10},isSolar:!1,radius:4e8,phi:10},a.prototype.addTo=function(a){this._map=a,h=this.three3D=a.three3D,this.projection=a.projection,this.init(this.options),this.loop()},a.prototype.init=function(b){var d=this._map;this.lightMax=2;var e=this.three3D,a=this.spot=new c.SpotLight(b.spot.color,b.spot.intensity);a.lookAt(d.options.center||d.center),a.castShadow=!0,a.shadowMapWidth=1024,a.shadowMapHeight=1024,e.add(a);var f=this.ambient=new c.AmbientLight(b.ambient.color,b.ambient.intensity);e.add(f),this.initSolar()},a.prototype.initSolar=function(n){function i(){if(e<=2)return;var g=new c.Color(16777215);g.setHSL(k,j,j+.5);var f=d.lensFlare=new c.LensFlare(m,700,0,c.AdditiveBlending,g);f.add(k,512,0,c.AdditiveBlending),f.add(k,512,0,c.AdditiveBlending),f.add(k,512,0,c.AdditiveBlending),f.add(a,60,.6,c.AdditiveBlending),f.add(a,70,.7,c.AdditiveBlending),f.add(a,120,.9,c.AdditiveBlending),f.add(a,70,1,c.AdditiveBlending),f.customUpdateCallback=b,d.three3D.add(f),d.updateSolarPos(),d.updateSolar()}var f=new c.TextureLoader,k=.55,l=.9,j=.5,d=this,e=0,m,h,a;f.load(g.lensflare0,function(a){m=a,e++,i()}),f.load(g.lensflare2,function(a){k=a,e++,i()}),f.load(g.lensflare3,function(b){a=b,e++,i()})},a.prototype.updateOptions=function(a){this.options=d.deepMerge(this.options,a),this.updateSolar(),this.updateSolarPos()},a.prototype.updateSolar=function(){var a=this.options,b=new c.Color(a.ambient.color);this.ambient.color.setRGB(b.r,b.g,b.b),this.ambient.intensity=a.ambient.intensity;var d=new c.Color(a.spot.color);this.spot.color.setRGB(d.r,d.g,d.b),this.spot.intensity=a.spot.intensity;var e=a.isSolar;if(e)return this.lensFlare.visible=!0;this.lensFlare.visible=!1},a.prototype.genMaterial=function(b){var a={side:c.BackSide,color:16711680};return new c.MeshBasicMaterial(a)},a.prototype.updateSolarPos=function(){var a=this.options.radius||this.projection.radius*8,b=this.options.phi,c=a*Math.cos(b),d=a*Math.sin(-.044444444444444446*Math.PI),e=a*Math.sin(b);this.spot.position.set(c,d,e),this.lensFlare&&this.lensFlare.position.set(c,d,e)},a.prototype.setSolar=function(a){a=a||2;var c=a/this.lightMax,b=this.lensFlare.lensFlares;for(var d in b){var e=b[d];e.opacity=c}},a.prototype.update=function(){this.phi+=.001,this.updateSolarPos()},a.prototype.loop=function(){this.update(),e(this.update.bind(this))},module.exports=a | ||
function a(b){this.options=d.deepMerge(a.options,b)}function b(c){var b,d=this.lensFlares.length,a,e=-this.positionScreen.x*2,f=-this.positionScreen.y*2,h=c.size?c.size:35e6,i=g.camera,j=i.position.length();for(b=0;b<d;b++)a=this.lensFlares[b],a.x=this.positionScreen.x+e*a.distance,a.y=this.positionScreen.y+f*a.distance,a.scale=h/j,a.rotation=0}var c=require('three'),d=require('./../core/utils'),e=d.requestAnimationFrame,f=require('./addons/lensflare_base64'),g;a.options={ambient:{color:'#fff',intensity:.5},spot:{color:'#333',intensity:10},isSolar:!1,radius:4e8,phi:10},a.prototype.addTo=function(a){this._map=a,g=this.three3D=a.three3D,this.projection=a.projection,this.init(this.options),this.loop()},a.prototype.init=function(b){var d=this._map;this.lightMax=2;var e=this.three3D,a=this.spot=new c.SpotLight(b.spot.color,b.spot.intensity);a.lookAt(d.options.center||d.center),a.castShadow=!0,a.shadowMapWidth=1024,a.shadowMapHeight=1024,e.add(a);var f=this.ambient=new c.AmbientLight(b.ambient.color,b.ambient.intensity);e.add(f),this.initSolar()},a.prototype.initSolar=function(n){function i(){if(e<=2)return;var g=new c.Color(16777215);g.setHSL(k,j,j+.5);var f=d.lensFlare=new c.LensFlare(m,700,0,c.AdditiveBlending,g);f.add(k,512,0,c.AdditiveBlending),f.add(k,512,0,c.AdditiveBlending),f.add(k,512,0,c.AdditiveBlending),f.add(a,60,.6,c.AdditiveBlending),f.add(a,70,.7,c.AdditiveBlending),f.add(a,120,.9,c.AdditiveBlending),f.add(a,70,1,c.AdditiveBlending),f.customUpdateCallback=b,d.three3D.add(f),d.updateSolarPos(),d.updateSolar()}var g=new c.TextureLoader,k=.55,l=.9,j=.5,d=this,e=0,m,h,a;g.load(f.lensflare0,function(a){m=a,e++,i()}),g.load(f.lensflare2,function(a){k=a,e++,i()}),g.load(f.lensflare3,function(b){a=b,e++,i()})},a.prototype.updateOptions=function(a){this.options=d.deepMerge(this.options,a),this.updateSolar(),this.updateSolarPos()},a.prototype.updateSolar=function(){var a=this.options,b=new c.Color(a.ambient.color);this.ambient.color.setRGB(b.r,b.g,b.b),this.ambient.intensity=a.ambient.intensity;var d=new c.Color(a.spot.color);this.spot.color.setRGB(d.r,d.g,d.b),this.spot.intensity=a.spot.intensity;var e=a.isSolar;if(e)return this.lensFlare.visible=!0;this.lensFlare.visible=!1},a.prototype.genMaterial=function(b){var a={side:c.BackSide,color:16711680};return new c.MeshBasicMaterial(a)},a.prototype.updateSolarPos=function(){var a=this.options.radius||this.projection.radius*8,b=this.options.phi,c=a*Math.cos(b),d=a*Math.sin(-.044444444444444446*Math.PI),e=a*Math.sin(b);this.spot.position.set(c,d,e),this.lensFlare&&this.lensFlare.position.set(c,d,e)},a.prototype.setSolar=function(a){a=a||2;var c=a/this.lightMax,b=this.lensFlare.lensFlares;for(var d in b){var e=b[d];e.opacity=c}},a.prototype.update=function(){this.phi+=.001,this.updateSolarPos()},a.prototype.loop=function(){this.update(),e(this.update.bind(this))},module.exports=a |
@@ -5,3 +5,3 @@ { | ||
"description": "3d map visualization lib", | ||
"version": "0.1.19", | ||
"version": "0.1.21", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "test": "mocha -r jscoverage test" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
200888