I have created a web map with mapimagelayer , which has 3 feature layers. I pre loaded web map in html with arcgis enterprise portal
const query = fl.createQuery();
Solved! Go to Solution.
Performance depends on a lot of factors. The complexity of the data and number of sublayers ect, but FeatureLayer should be as performant as MapImageLayer in most situations. It also can speed some things up if you take advantage of the client side capabilities of FeatureLayer.
Yes using Graphics on the view or in a GraphicsLayer is a pretty common way of "highlighting" features based off a MapImageLayer.
Hi @vijaybadugu, thanks for posting your question here. I think it might be helpful to review the doc for layers and layerviews:
https://developers.arcgis.com/javascript/latest/query-filter/
And here are some samples for inspiration:
https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query-geometry/
https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/
Thanks for your reply. I have gone through all these links. if you add the layer to the view, it is able to highlight the features. we have already added the web map to the view and we just retrieving the layers in it. I was able to query features and returning feature results as expected. The problem is timing issue. which event or method check that, entire web map is loaded completed or not . so that, I can see all the features on the map. then only, I can create / get layer view. we don't have any button to click and get the results. it is supposed to happen on page load.
I am using below code to retrieve the map and view. in both objects, I could see the MapimageLayer and it's sublayers(each featurelayer)
arcgisMap.addEventListener("arcgisViewReadyChange", (event) => {
const view = event.target.view;
const map = event.target.map;
Hi @vijaybadugu ,
MapImageLayers don't have FeatureLayers inside them really, they have Sublayers. You can create a new feature layer from a sublayer if you create a `new FeatureLayer({url: "url to the sublayer endpoint"})`, but if the layer was added to your WebMap as a MapImageLayer you can't really extract a FeatureLayer from it.
MapImageLayers don't have a LayerView, leading to the "LayerView has not been found" error. They only function as a server side layer so you can't do things like client side queries or analysis on them. I would suggest trying to add the layers as FeatureLayers to the WebMap and then you would be able to access the layer view.
Creating a web map is one time activity and don't want to touch it again or add manually in the code. I would like to follow same structure for rest of our maps. you said, it is not possible is get feature layers at the client side as a layer view. we usually publish all layers as dynamic layers (map image layer) and same is adding to the web map without changing any structure of it. is there a way to change in web map as a group layer instead of map image layer? does it work? or the behavior same for all? when we add the layers, it treated as map image layer or group layer not individual feature classes. if this works, it saves lot of time for us.
It worked if add them as Indvidual map service layer to the web map.
Awesome I'm glad you got it working. You should be able to group them into group layers in the Web Map if you need to organize them
Does it impact on performance of the web map? If we use individual layers over map image layer. can we use graphics instead of layerview highlighting?
Performance depends on a lot of factors. The complexity of the data and number of sublayers ect, but FeatureLayer should be as performant as MapImageLayer in most situations. It also can speed some things up if you take advantage of the client side capabilities of FeatureLayer.
Yes using Graphics on the view or in a GraphicsLayer is a pretty common way of "highlighting" features based off a MapImageLayer.