/* ------------------------------------------------------------------------------------*/ // Let's assume that we have a dynamic layer with id "dynamicLayerId" on the map // and the sublayer of "dynamicLayerId" with id 0 is the parent of sublayers with ids 1 and 2 // // This code will swap sublayers 1 and 2 and display them on the map /* ------------------------------------------------------------------------------------*/ var layer = map.getLayer("dynamicLayerId"); var dynamicLayerInfos = layer.createDynamicLayerInfosFromLayerInfos(); // changing the order dynamicLayerInfos[1].id = 2; dynamicLayerInfos[2].id = 1; // updating the dynamic infos of the layer layer.setDynamicLayerInfos(dynamicLayerInfos); // display the sublayers on the map layer.setVisibleLayers(["1", "2"]);
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.