We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在开发中,操作circle时需要当前对象的一些属性等,于是用到了extData 代码如下
<Circle extData={{ mykey: 'mykey' }} events={this.circleEvents} center={{ longitude, latitude }} radius={endDistance * 1000} /> this.circleEvents = { click: ({ type, target, lnglat }) => { // 这里需要获取到extData console.log(target.B.extData.mykey ) }, };
开发完毕 上线了 然而一段时间迭代后 发现 target.B不存在,再次打印后发现extData放在target.Ce下了,请问这种情况 有什么办法根治呢
target.B
target.Ce
The text was updated successfully, but these errors were encountered:
我做的项目昨天也出现了这个问题,我原本的是e.target.D.extData,现在就获取不到了,看返回结果要写成e.target.Ce.extData,改了这个地方以后点击又报Uncaught Invalid Object: Pixel(NaN, 0.5536250569814856),但是打印出来的确传了正确的经纬度,不知道你有遇到这种情况吗?
Sorry, something went wrong.
确实是有这个问题的,我也遇到了,目前看这个库已经没人维护了,那就筛选下吧从object中,判断下是否包含extData的属性
export function hasObjectKey(params: object) { for (const key in params) { const item = params[key]; if (Object.prototype.hasOwnProperty.call(item, 'extData')) { return item; } } }
No branches or pull requests
Reproduce Example Link or Code Fragment
在开发中,操作circle时需要当前对象的一些属性等,于是用到了extData 代码如下
开发完毕 上线了 然而一段时间迭代后 发现
target.B
不存在,再次打印后发现extData放在target.Ce
下了,请问这种情况 有什么办法根治呢The text was updated successfully, but these errors were encountered: