LayerSwipe destroy

1458
17
Jump to solution
10-13-2013 10:16 PM
OrenGal
New Contributor III
Hi,
I have a toggle button for enabling and disabling the LayerSwipe.
After destroy(), one of the layers in the swipe is cropped.
application: http://gisn.tel-aviv.gov.il/iview2js/index.aspx

Tried in addition to add these lines to the destroy function:

LayerSwipe.disable();
LayerSwipe.destroy();
LayerSwipe=null;

CroppedTiledLayer.hide();
CroppedTiledLayer.show();
CroppedTiledLayer.refresh();
CroppedTiledLayer.resume();

But still layer is cropped (only sometimes, mostly IE10, can't understand it).
Thanks,
Oren.
0 Kudos
1 Solution

Accepted Solutions
MattDriscoll
Esri Contributor
Try this file. I think you just need to remove the 'zesri'. That's just there so that it's loaded as a custom module. This file should work though.

View solution in original post

0 Kudos
17 Replies
MattDriscoll
Esri Contributor
Hi Oren,

It sounds like the CSS clip isn't being removed in some IE. I'll dig deeper to see if I can find a solution. Since you already called .disable() that "should" have cleared it up but apparently it isn't working. I will check in an update on github and let you know when there's a fix. there might be a easy solution as well.

I just need to figure out the correct way to clear the CSS clip on the layer's node for the IE that is failing.

Thanks
0 Kudos
MattDriscoll
Esri Contributor
The IE issue should be fixed for next version.

You can grab the latest code here if you need it now: https://github.com/driskull/arcgis-dijit-layer-swipe-js

Let me know if you still see the issue here:

http://driskull.github.io/arcgis-dijit-layer-swipe-js/
0 Kudos
OrenGal
New Contributor III
Hi Matt,
Thanks for the fast fix! How do I merge the LayerSwipe.js from GitHub to my project?
Tried to put the file here  ..\wwwroot\arcgis_js_api\library\3.7\3.7\js\esri\dijit
but then the app didn't start. What am I missing?
Oren
0 Kudos
MattDriscoll
Esri Contributor
Try this file. I think you just need to remove the 'zesri'. That's just there so that it's loaded as a custom module. This file should work though.
0 Kudos
OrenGal
New Contributor III
Didn't remove a thing. just copied it. Works like a charm.
Thanks again Matt!
http://gisn.tel-aviv.gov.il/iview2js/index.aspx  (with fix)
0 Kudos
MattDriscoll
Esri Contributor
Cool. this will be in 3.8.
0 Kudos
OrenGal
New Contributor III
Hi Matt,
I have another minor minor issue: when I press the first time the toggle button,
the splitter appears but the background is not changed.
Only when I start to move the splitter right or left, only then the background changes.
Can you please check it?
Thanks,
Oren
http://gisn.tel-aviv.gov.il/iview2js/
0 Kudos
MattDriscoll
Esri Contributor
Hi Oren,

It's kind of hard to test since the services are so slow viewing from here. Is it just the first time that's a problem?

Can you try the attached?

I also see an error with a layer.
0 Kudos
OrenGal
New Contributor III
Thanks Matt, but the result remains.
I will make a small project and send you with Esri services.
Oren
0 Kudos