1
クライアントサイドのグラフィックスでコールアウトラインを使用するのに苦労しています。クライアントのグラフィックスで3Dコールアウトラインが機能しない
のフィーチャレイヤを使用するが続きました。
しかし、Webサービスから返されたデータに基づいてクライアント側のグラフィックを作成する機能レイヤーでは機能しません。
3Dコールアウトラインには制限がありますか?ここで
は私のコードスニペットです:ここで
featureLayer.elevationInfo = {
// elevation mode that will place points on top of the buildings or other SceneLayer 3D objects
mode: "relative-to-scene"
};
// feature reduction is set to selection because our scene contains too many points and they overlap
featureLayer.featureReduction = {
type: "selection"
};
featureLayer.renderer = this._getUniqueValueRenderer() as any as Renderer// callout render
:
featureLayer = new FeatureLayer({
fields: this.layerDefinition.fields,
objectIdField: this.layerDefinition.objectIdField,
geometryType: this.layerDefinition.geometryType,
id: this.layerId
});
が設定標高と機能の削減とレンダラ:
は、層の定義に基づいて、フィーチャレイヤを作成します。レンダラーコード:
グラフィックスの配列への_getUniqueValueRenderer() { let verticalOffset = { // verticalOffset shifts the symbol vertically screenLength: 150, // callout line length maxWorldLength: 200, minWorldLength: 35 }, uniqueValueRenderer = { type: "unique-value", // autocasts as new UniqueValueRenderer() field: "AQHI", uniqueValueInfos: [{ value: 1, symbol: this._get3DCallOutSymbol(verticalOffset, "Museum.png", "#D13470") }, { value: 2, symbol: this._get3DCallOutSymbol(verticalOffset, "Restaurant.png", "#F97C5A") }, { value: 3, symbol: this._get3DCallOutSymbol(verticalOffset, "Church.png", "#884614") }, { value: 4, symbol: this._get3DCallOutSymbol(verticalOffset, "Hotel.png", "#56B2D6") }, { value: 5, symbol: this._get3DCallOutSymbol(verticalOffset, "Park.png", "#40C2B4") }, { value: 6, symbol: this._get3DCallOutSymbol(verticalOffset, "Museum.png", "#D13470") }, { value: 7, symbol: this._get3DCallOutSymbol(verticalOffset, "beer.png", "#F97C5A") }, { value: 8, symbol: this._get3DCallOutSymbol(verticalOffset, "senate.png", "#884614") }, { value: 9, symbol: this._get3DCallOutSymbol(verticalOffset, "Hotel.png", "#56B2D6") }, { value: 10, symbol: this._get3DCallOutSymbol(verticalOffset, "Park.png", "#40C2B4") } ]}; return uniqueValueRenderer; } _get3DCallOutSymbol(verticalOffset: any, iconName: string, color: string) { return { type: "point-3d", // autocasts as new PointSymbol3D() symbolLayers: [{ type: "icon", // autocasts as new IconSymbol3DLayer() resource: { href: this.iconPath + iconName }, size: 20, outline: { color: "white", size: 2 } }], verticalOffset: verticalOffset, callout: { type: "line", // autocasts as new LineCallout3D() color: "white", size: 2, border: { color: color } } }; }
セット要因は、あなたがインスタンス化新しいFeatureLayerに
this.layerDefinition
を使用しますが、新しいVARにそれを置くべきではありませんfeatureLayer.source = graphics;