I am new to this and found this thread very helpful:
I would like to combine Buffer & Show Parcels Intersecting Buffer function into one so when user click on buffer will show buffer ring and parcel results. Can you show me how to change it? Thank you.
function applyBufferP() {
var graphics = featureLayerParcel.graphics;
var selectedGeoms = graphicsUtils.getGeometries(graphics);
var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([0, 0, 255, 0.65]), 2
),
new Color([0, 0, 255, 0.35])
);
geometryEngineAsync.buffer(selectedGeoms, [100], GeometryService.UNIT_FOOT, true).then(
function (geoms) {
arrayUtils.forEach(geoms, function (geometry) {
map.graphics.add(new Graphic(geometry, symbol));
});
bufferGra = geoms;
}
);
intersectParcels()
}
Solved! Go to Solution.
James,
Sure, you just have the intersectParcels in the wrong place.
function applyBufferP() { var graphics = featureLayerParcel.graphics; var selectedGeoms = graphicsUtils.getGeometries(graphics); var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 0, 255, 0.65]), 2 ), new Color([0, 0, 255, 0.35]) ); geometryEngineAsync.buffer(selectedGeoms, [100], GeometryService.UNIT_FOOT, true).then( function (geoms) { arrayUtils.forEach(geoms, function (geometry) { map.graphics.add(new Graphic(geometry, symbol)); }); bufferGra = geoms; intersectParcels(); } ); }
James,
Sure, you just have the intersectParcels in the wrong place.
function applyBufferP() { var graphics = featureLayerParcel.graphics; var selectedGeoms = graphicsUtils.getGeometries(graphics); var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 0, 255, 0.65]), 2 ), new Color([0, 0, 255, 0.35]) ); geometryEngineAsync.buffer(selectedGeoms, [100], GeometryService.UNIT_FOOT, true).then( function (geoms) { arrayUtils.forEach(geoms, function (geometry) { map.graphics.add(new Graphic(geometry, symbol)); }); bufferGra = geoms; intersectParcels(); } ); }
Thank you very much.