function Graphic.getDojoShape() works fine in js api 3. but it does not work in 4.6 . Is there any way to solve this issue?
I am not sure that symbolPreview is what i need. All that i need is to highlight some layer with animation. For that i use "graphicFlash.getDojoShape()" because then i pass this to dojoFx; Let me show some part of my code.
let rLayer = this.sharedService.map.getLayer(x); let items: any[] = rLayer.graphics;//.filter(x => this.sharedService.map.extent.intersects(x._extent));
items.forEach(graphicHighlight => { let graphicFlash; switch (graphicHighlight.geometry.type) { case "point": case "esriGeometryMultipoint": .................. case "multipoint": ............................ case "polyline": ....................................... case "polygon": case "extent": var symbolFlashPolygon = new this.SimpleFillSymbol(this.SimpleFillSymbol.STYLE_SOLID, new this.SimpleLineSymbol(this.SimpleLineSymbol.STYLE_SOLID, new this.mapLayerService.Color([255, 0, 0]), 2), new this.mapLayerService.Color([255, 0, 0, 0.25])); _extent = graphicHighlight.geometry.getExtent(); graphicFlash = new this.Graphic(graphicHighlight.geometry, symbolFlashPolygon); break; } if (this.sharedService.map.extent.intersects(_extent)) { this.sharedService.map.graphics.add(graphicFlash);
let shape = graphicFlash.getDojoShape();
if (shape != null) { let animStroke = this.dojoFx.animateStroke({ shape: shape, duration: 10000, color: { end: new this.mapLayerService.Color([0, 0, 0, 0]) } }); var animFill: any; if (isLine) { animFill = this.dojoFx.animateTransform({ shape: shape, duration: 1000, color: { end: new this.mapLayerService.Color([0, 0, 0, 0]) } // color: { start: "red", end: color } }); } else { animFill = this.dojoFx.animateFill({ shape: shape, duration: 1000, color: { end: new this.mapLayerService.Color([0, 0, 0, 0]) } //color: { start: "red", end: color } }); }
var anim = this.coreFx.combine([animStroke, animFill]).play(); this.aspect.after(anim, "onEnd", function () { self.sharedService.map.graphics.remove(graphicFlash); }); } }
});
Sergey,
So you are saying you do not know how to use symbolPreview?
Yes, i seen that. But i used this function, and now i am not sure how to change my code to get it working .
If you are just looking to get the swatches (like what is used in the legend) then you need to use symbolPreview.
According to the Functionality Matrix, this ability isn't planned for the 4.x release
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.