Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in add & remove layer #175

Closed
AbdulSamim opened this issue Apr 5, 2018 · 1 comment
Closed

Issue in add & remove layer #175

AbdulSamim opened this issue Apr 5, 2018 · 1 comment

Comments

@AbdulSamim
Copy link

Hi @tmcgee ,

1.While removing layer from map using this code inside LayerControl.js
this.map.removeLayer(control.layer) required layer is removed from the map viewer, but still this.layerInfos having information of removed layers.
OR I am using (layerControl/removeLayerControls) in this case layer is not removed from
Map and TOC

_Removeservice: function (control) {
var layerControlInfo = {
controlOptions: {
expanded: false,
noLegend: true,
metadataUrl: false,
swipe: false
},
layer: control.layer,
title: control.layer.id,
type: 'dynamic'
};

    topic.publish('layerControl/removeLayerControls', [layerControlInfo]);

}

2.While adding dynamic service programmatically in map viewer it is adding but in TOC not getting updated.

var imageParameters = new ImageParameters();
imageParameters.layerIds = visibleLayers;
imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW;
imageParameters.transparent = true;

var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(url,
{ "imageParameters": imageParameters });
this.map.addlayer(dynamicMapServiceLayer);

             var layerControlInfo = {
                 controlOptions: {
                     expanded: false,
                     noLegend: true,
                     metadataUrl: false,
                     swipe: false
                 },
                 layer: dynamicMapServiceLayer,
                 title: 'Cities',

                 type: 'dynamic'
             };
             topic.publish('layerControl/addLayerControls', [layerControlInfo]);

Please let me know how to update/refresh layercontrol after adding or removing service/layer from the map.

Any lead on this will be of great help.
Thanks in Advance.
Samim

@tmcgee
Copy link
Owner

tmcgee commented Apr 5, 2018

duplicate of #173.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants