I'm looking for an option that we could highlight the buildings on the GIS map with different colors.
Example: Office buildings in one color and Hotel buildings in a different color when map loading.
I have found only the option of highlighting buildings with the same color. Though we try to change the color of one building it gets affected to the buildings that have already been highlighted with a different color.
Is there any possibility to load the map with different colors for buildings?
You might have to use a graphics layer instead of a highlight.
I have done by creating a renderer for a featureLayer which had the buildings and assigned a different fill color based on the type of building provided by one of the field in the featureLayer.
const buildingRenderer = {
type: "unique-value",
field: "BUILDING_TYPE",
uniqueValueInfos: [
createFillSymbol("type1", "#838898"),
createFillSymbol("type2", "#A7C636"),
createFillSymbol("type3", "#149ECE"),
createFillSymbol("type4", "#ED5151"),
createFillSymbol("type5", "#111111")
]
};
Actually, I realize that this doesn't solve highlighting buildings with a different color. Sorry.
Maybe look at this post: https://community.esri.com/t5/arcgis-api-for-javascript-questions/highlight-multiple-objects-in-diff...
Thanks for the reply, I have followed the same link that you shared, but the issue that i have faced was that we have only one layer, So if we set the different color to another building all the building turn to same color that we set.