Select to view content in your preferred language

GetFullExtent zooming out, but Dynamic Layers are blank

2114
16
02-18-2011 06:14 AM
KevinSesock
Emerging Contributor
We're not sure if this has to do with our service, or with our silverlight viewer, but we have an issue with when zooming out to the full extent of our map, set by the ConstrainFullExtent property, we have an issue where our dynamic layers disappear. This seems to be similar to this issue, here:

http://forums.arcgis.com/threads/18071-Graphic-objects-disappearing-when-zoom-in-out?highlight=Layer...

As in one of our other maps (currently on API 2.0), we have the issue where when full zoomed out, zooming in requires several mouse clicks that don't seem to zoom you in very fast.

Both maps seem to have an issue where our Dynamic layer "disappears" at full extent. This is most easily replicated by Map.ZoomTo(Map.Layers.GetFullExtent()); (in our Legacy Toolbar, the Full Extent button).

Our map experiencing this issue, is here:

http://www.owrb.ok.gov/learn/GWQ-sl/

You may have to adjust your browser size, as it doesn't do this at all browser sizes.
0 Kudos
16 Replies
JenniferNery
Esri Regular Contributor
Please go through this blog post for troubleshooting blank layers http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx. Fiddler might be able to tell us whether a web request for that layer was sent or not and if any failure had occurred.
0 Kudos
KevinSesock
Emerging Contributor
No dice on any of these. Let me be clear, I can see all of my layers, except when zoomed to full extent.
0 Kudos
DanielWalton
Frequent Contributor
Weird problem. Are you ignoring any exceptions anywhere in your app? E.g.
try 
{
//code
}
catch
{
//empty catch block
}

Also, it might be related to the way your map control extent and layer extents are set up. Couldn't say much more without seeing some code.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Hi Kevin,

I tried to reproduce your issue, but I don't understand what type of constrainextentbehavior you set up.

It looks like we are not able to zoom out after reaching the full extent (normal), but we are able to pan outside this extent(and then even zoom out to a large extent). This looks strange to me.

Could you help me on this point?

Thanks
0 Kudos
KevinSesock
Emerging Contributor
           <esri:Map x:Name="BaseWIMS" IsLogoVisible="False" ExtentChanged="BaseWIMS_ExtentChanged" Extent="-98.220507, 36.188768, -96.225105, 34.716448" MouseClick="QueryPoint_MouseClick" >
                <i:Interaction.Behaviors>
                    <esri:MaintainExtentBehavior />
                    <esri:ConstrainExtentBehavior ConstrainedExtent="-98.220507, 36.188768, -96.225105, 34.716448" />
                </i:Interaction.Behaviors>
                <esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
                <esri:ArcGISDynamicMapServiceLayer ID="BoundaryLayer" Url="http://rest.owrb.ok.gov/ArcGIS/rest/services/Special_Studies/Garber_GWQ_Max_Metals_Boundary_WGS84/MapServer"  Opacity=".85"/>
                <esri:ArcGISDynamicMapServiceLayer ID="CountyLayer" Url="http://rest.owrb.ok.gov/ArcGIS/rest/services/Base/SDE_State_County_PLSS_WGS84/MapServer" InitializationFailed="CountyLayer_InitializationFailed" Opacity=".9"/>
                <esri:ArcGISDynamicMapServiceLayer ID="DynamicLayer" Url="http://rest.owrb.ok.gov/ArcGIS/rest/services/Special_Studies/Garber_GWQ_Max_Metals_WGS84/MapServer" Initialized="ArcGISDynamicMapServiceLayer_Initialized" InitializationFailed="ArcGISDynamicMapServiceLayer_InitializationFailed" />
                <esri:GraphicsLayer ID="GraphicsLayer" />
            </esri:Map>
For reference, BaseWIMS_ExtentChanged is for the ToolbarWidget. It does have a Try/Catch block but I'm not seeing any exceptions.

I have a UserControl_Loaded method that is wired up to "Loaded" on the root UserControl object in the XAML, and here's what it's doing:

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            //Show disclaimer at startup, after splash screen.
            lblDisclaimer_Link(sender, e);
            BaseWIMS.MinimumResolution = .0001;
   //Fix for broken ConstrainExtentBehavior in SL4.
            /*System.Windows.Interactivity.Behavior behavior = new ESRI.ArcGIS.Client.Behaviors.ConstrainExtentBehavior()
            {
                ConstrainedExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(-98.220507, 36.188768, -96.225105, 34.716448)
            };
            System.Windows.Interactivity.Interaction.GetBehaviors(BaseWIMS).Add(behavior); */
            BaseWIMS.Cursor = Cursors.Hand;
        }
As you can see, I did have an issue with the 2.0 API that had to do with ConstrainExtentBehavior (from what I recall this was a known issue), but this seems to be working in 2.1, so I've commented the code.

Other than that, I'm not sure what would be causing this issue.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Hi Kevin,

Yours YMin and Ymax are reversed:

<esri:ConstrainExtentBehavior ConstrainedExtent="-98.220507, 36.188768, -96.225105, 34.716448" />


That being said, I am not sure this will solve your issue (I was not able to reproduce it), but at least this will prevent to pan outside the constraint extent.
So I think it's worth the try after fixing the order.

If you still get the issue, could you test without the 'MaintainExtentBehavior'?
0 Kudos
KevinSesock
Emerging Contributor
Reversing the YMin and YMax actually made it worse (it was doing the same thing further out and zooming in was very... clunky, for lack of a better word).

Taking out the ConstrainExtentBehavior however, definitely resolved the issue. The dynamic layers are displaying at all resolutions now. However, I can't have my full extent be the maximum extent of the base map layer (in other words, the entire world).

Would you like me to upload with the reversed YMin and YMax so you can see the effects?
0 Kudos
DominiqueBroux
Esri Frequent Contributor

Would you like me to upload with the reversed YMin and YMax so you can see the effects?

Yes, please, this might help me to have a clue.

Did you test without the MaintainExtentBehavior as well?

And could you test without the BaseWIMS_ExtentChanged as well?

Thanks
0 Kudos
KevinSesock
Emerging Contributor
New version uploaded to http://www.owrb.ok.gov/learn/GWQ-sl/

This has no MaintainExtentBehavior (taking it out didn't seem to change anything), and I put ConstrainExtentBehavior back into the XAML and took it out of the UserControl_Loaded method in the code-behind.

This is what I have at the moment:

            <esri:Map x:Name="BaseWIMS" IsLogoVisible="False" ExtentChanged="BaseWIMS_ExtentChanged" Extent="-98.220507, 34.716448, -96.225105, 36.188768" MouseClick="QueryPoint_MouseClick" >
                <i:Interaction.Behaviors>
                    <!-- <esri:MaintainExtentBehavior />-->
                    <esri:ConstrainExtentBehavior ConstrainedExtent="-98.220507, 34.716448, -96.225105, 36.188768" />
                </i:Interaction.Behaviors>
                <esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
                <esri:ArcGISDynamicMapServiceLayer ID="BoundaryLayer" Url="http://rest.owrb.ok.gov/ArcGIS/rest/services/Special_Studies/Garber_GWQ_Max_Metals_Boundary_WGS84/MapServer"  Opacity=".85"/>
                <esri:ArcGISDynamicMapServiceLayer ID="CountyLayer" Url="http://rest.owrb.ok.gov/ArcGIS/rest/services/Base/SDE_State_County_PLSS_WGS84/MapServer" InitializationFailed="CountyLayer_InitializationFailed" Opacity=".9"/>
                <esri:ArcGISDynamicMapServiceLayer ID="DynamicLayer" Url="http://rest.owrb.ok.gov/ArcGIS/rest/services/Special_Studies/Garber_GWQ_Max_Metals_WGS84/MapServer" Initialized="ArcGISDynamicMapServiceLayer_Initialized" InitializationFailed="ArcGISDynamicMapServiceLayer_InitializationFailed" />
                <esri:GraphicsLayer ID="GraphicsLayer" />
            </esri:Map>
0 Kudos