arcgis js 4 用pixi.js 做 缩放圆

这次我们用pixi.js 做缩放圆和arcgis js结合

我们先定义一下 传入数据结构

let option = {
renderer: {
type: "simple",
symbol: {
color: "#FF3366",
radius: 20,
width: 4,
}
},
data: [
{
geometry: [11581249.298924139, 3596576.264215719],
attributes: {
name: "成都"
}
},
{
geometry: [9747738.924467796, 5447697.909138256],
attributes: {
name: "乌鲁木齐"
}
}
]
};

对于缩放动画 我们使用gsap 来建立

import {TimelineMax, TweenLite} from "gsap/gsap-core";
对于symbol 里面的color转换 我们写一个方法转成pixi的color 范式

function getColor(str: string, alpha = 1){
if (alpha > 1 || alpha < 0) {
return "透明度 Error value!";
}
//如果传入常规的颜色值,去除#
str = str.toString();
if (str.startsWith('#')) {
str = str.replace('#', '');
}
alpha = 255 * alpha;
// @ts-ignore
alpha = alpha.toString(16);
str = alpha + str;
alpha = parseInt(str, 16);
return alpha;
}

对于圆形带有模糊效果 我们使用pixi.js 滤镜库

//添加模糊滤镜
let bloomFilter = new PIXI.filters.BlurFilter(6, 8);
sprite.filters = [bloomFilter]

更多参考 https://xiaozhuanlan.com/topic/6129380475

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值