(serverUrl, options)
| 25 | */ |
| 26 | export class GraphMap extends maplibregl.Evented { |
| 27 | constructor(serverUrl, options) { |
| 28 | super(serverUrl, options); |
| 29 | /** |
| 30 | * @member GraphMap.prototype.graph |
| 31 | * @description KnowledgeGraph 的实例。 |
| 32 | * |
| 33 | */ |
| 34 | this.graph = null; |
| 35 | /** |
| 36 | * @member GraphMap.prototype.EVENT_TYPES |
| 37 | * @description 监听一个自定义事件可用如下方式: |
| 38 | * |
| 39 | * 支持的事件如下: |
| 40 | * loaded - 渲染完成时触发。 |
| 41 | */ |
| 42 | this.EVENT_TYPES = ['loaded']; |
| 43 | const graphMapName = serverUrl.split('/').pop(); |
| 44 | this.url = serverUrl.replace(`/graphmaps/${graphMapName}`, ''); |
| 45 | this.createGraphMap(graphMapName, options); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * @private |
nothing calls this directly
no test coverage detected