Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
maptalks.three
Advanced tools
A maptalks Layer to render with THREE.js
npm install maptalks.three
.https://unpkg.com/maptalks.three/dist/maptalks.three.min.js
As a plugin, maptalks.three
must be loaded after maptalks.js
and THREE.js
in browsers.
<script type="text/javascript" src="https://unpkg.com/three@0.97.0/build/three.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/maptalks/dist/maptalks.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/maptalks.three/dist/maptalks.three.js"></script>
<script>
var threeLayer = new maptalks.ThreeLayer('t');
threeLayer.prepareToDraw = function (gl, scene, camera) {
var light = new THREE.DirectionalLight(0xffffff);
light.position.set(0, -10, -10).normalize();
scene.add(light);
var me = this;
countries.features.forEach(function (g) {
var num = g.properties.population;
var color = getColor(num);
var m = new THREE.MeshPhongMaterial({color: color, opacity : 0.7});
var mesh = me.toExtrudeMesh(maptalks.GeoJSON.toGeometry(g), num / 4E2, m);
if (Array.isArray(mesh)) {
scene.add.apply(scene, mesh);
} else {
scene.add(mesh);
}
});
};
map.addLayer(threeLayer);
</script>
With ES Modules:
import * as THREE from 'three';
import * as maptalks from 'maptalks';
import { ThreeLayer } from 'maptalks.three';
const map = new maptalks.Map('map', { /* options */ });
const threeLayer = new ThreeLayer('t');
threeLayer.prepareToDraw = function (gl, scene, camera) {
const light = new THREE.DirectionalLight(0xffffff);
light.position.set(0, -10, -10).normalize();
scene.add(light);
//...
};
threeLayer.addTo(map);
IE 11, Chrome, Firefox, other modern and mobile browsers that support WebGL;
ThreeLayer
is a subclass of maptalks.CanvasLayer and inherits all the methods of its parent.
Constructor
new maptalks.ThreeLayer(id, options)
We welcome any kind of contributions including issue reportings, pull requests, documentation corrections, feature requests and any other helps.
The only source file is index.js
.
It is written in ES6, transpiled by babel and tested with mocha and expect.js.
$ npm install
$ npm run dev
$ npm run build
$ npm run lint
npm version ${version}
npm publish
npm push master ${version}
FAQs
A maptalks Layer to render with THREE.js.
The npm package maptalks.three receives a total of 419 weekly downloads. As such, maptalks.three popularity was classified as not popular.
We found that maptalks.three demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.