cesiumlab / cesiumlab/XbsjEarthUI

继承的方式 写了个类 无法保存

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
documentation question
Dominant language
JavaScript
Stars
734
Forks
193
PR merge metrics
No merged PRs in 30d

Description

@vtxf 老哥
我通过继承的方式 写了个类, 然后实现这个类,但是保存场景加载的时候实例化的是被继承的类 而不是我自己写的这个。有办法解决不。。。
![image](https://user-images.githubusercontent.com/13550568/71758587-bc984500-2edc-11ea-8712-1895241bee3d.png)

---

自己扩展类,可以使用registerType,参考标会插件的写法:

https://github.com/cesiumlab/PlottingSymbol-EarthSDK/blob/master/src/GeoArc.js

![image](https://user-images.githubusercontent.com/13550568/71758590-c752da00-2edc-11ea-99e9-17cacc009a4c.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the registerType usage in the referenced PlottingSymbol-EarthSDK file, src/GeoArc.js, then trace how custom classes are serialized during scene saving and restored during loading. Done means a class created through inheritance is registered and scene reload instantiates the custom class rather than its parent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.