
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
@maptalks/transform-control
Advanced tools
transform-control a plugin to control model's translate、rotation and scale.
npm install @maptalks/transform-control.https://unpkg.com/@maptalks/transform-control/dist/transform-control.js<script type="text/javascript" src="../maptalks.transform-control.js"></script>
<script>
var map = new maptalks.Map("map",{
center : [0, 0],
zoom : 15
});
var transformControl = new maptalks.TransformControl();
transformControl.addTo(map);
transformControl.on('transforming', e => {
//get translate、rotation、scale
const translate = e.translate;
const rotation = e.rotation;
const scale = e.scale;
});
</script>
import TransfromControl from '@maptalks/transform-control';
const map = new maptalks.Map("map",{
center : [0, 0],
zoom : 15
});
const transformControl = new maptalks.TransformControl();
transformControl.addTo(map);
transformControl.on('transforming', e => {
const target = e.target;
target.setTRS(e.translate, e.rotation, e.scale);
});
transformControl.on('positionchange', e => {
const target = e.target;
target.setCoordinates(e.coordinate);
});
(inherited from maptalks.Eventable)transform control's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
id | String | transform control's id | |
options | Object | null | construct options |
add the control to a map
| Parameter | Type | Default | Description |
|---|---|---|---|
map | maptalks.Map | a map to add |
returns :
TransformControl: this
remove the control from map
specify a target to transform
| Parameter | Type | Default | Description |
|---|---|---|---|
target | GLTFMarker | Mesh | null | the target to transform |
get the current tranforming target
returns :
Object: the transforming target object
enable the control
returns :
TransformControl: return this
disable the control, when disable the control, it will be not available TransformControl: return this
whether the control is enable Boolean: true or false
when transforming the target, it will trigger transforming event
| Parameter | Type | Default | Description |
|---|---|---|---|
target | GLTFMarker | the target to transform | |
action | String | transforming action, includes xy-translate、x-translate、y-translate、z-translate、z-rotate、scale | |
type | GLTFMarker | event type name | |
translate | Array | current translate when transforming | |
scale | Array | current scale when transforming | |
rotation | Array | current rotation when transforming |
when changing target's position, it will trigger positionchange event
| Parameter | Type | Default | Description |
|---|---|---|---|
target | GLTFMarker | the target to transform | |
action | String | transforming action, includes xy-translate、x-translate、y-translate、z-translate、z-rotate、scale | |
type | GLTFMarker | event type name | |
coordinate | Array | current coordinate when changing target's position |
when endding the transform task, it will trigger transformend event
| Parameter | Type | Default | Description |
|---|---|---|---|
target | GLTFMarker | the target to be transformed | |
action | String | current action | |
type | GLTFMarker | event type name |
FAQs
a plugin to control model's translate、rotation and scale
The npm package @maptalks/transform-control receives a total of 717 weekly downloads. As such, @maptalks/transform-control popularity was classified as not popular.
We found that @maptalks/transform-control demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.