
Security News
/Research
Compromised Injective SDK npm Package Exfiltrates Wallet Keys and Mnemonics
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.
@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 883 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.

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

Security News
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.