Select to view content in your preferred language

Issue with setting MaxAllowableOffset?

2302
5
07-01-2012 02:19 PM
by Anonymous User
Not applicable
Original User: edson08

I am setting the MaxAllowableOffset using the following algorithm:

return MapApplication.Current.Map.Resolution * 2;
Doing this on initial map initialization event, and also map extent changed event for the feature layer in question.

This seems to speed up performance by from 60 sec to about 10 sec.
But the features "seem" to be distorted somehow.
The feature are lines mainly.

Please see attachments.

The one without MaxAllowableOffset is clean and have only single lines.
But the one with MaxAllowableOffset has duplication of lines.

That is the main issue: other is it possible to speed up performance even further from 10 sec to something like 1 sec?
0 Kudos
5 Replies
by Anonymous User
Not applicable
Original User: jenniferdnery

Does this also happen when zoomed out (no clipping)?
0 Kudos
EdwardSon
Emerging Contributor
Yes.  It appears so, though it's harder to see from higher levels.  but the lines seem duplicated....
First pic (No MaxAllowableOffset), second (With MaxAllowableOffset)

using:

return MapApplication.Current.Map.Resolution* pixelTolerance
where pxelTolerance ranged from 2 to 200, trying different values... same result as far as duplication of lines and also performance.  Seem no difference in performance, as long as MaxAllowableOffset is used.
0 Kudos
by Anonymous User
Not applicable
Original User: jenniferdnery

I'm using the following code and I can't seem to reproduce. I don't see the features duplicated. Can you share some code or could you maybe tweak this to get to the same state as your app? Thanks.

  <esri:Map x:Name="MyMap" WrapAround="True"
      PropertyChanged="MyMap_PropertyChanged"
      Extent="-9900723.24924544,3490730.30922668,-9828850.20838732,3542973.02580042">
   <esri:ArcGISTiledMapServiceLayer 
    Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
   <esri:FeatureLayer ID="MyLayer"
    Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hurricanes/NOAA_Tracks_1851_2007/MapServer/0"/>
  </esri:Map>


  private void MyMap_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
  {
   if (e.PropertyName == "Resolution")
   {
    var f = MyMap.Layers["MyLayer"] as FeatureLayer;
    f.MaxAllowableOffset = MyMap.Resolution * 2;
    f.Update();
   }
  }
0 Kudos
EdwardSon
Emerging Contributor
The multiple lines are gone now.  Didn't have the featureLayer2.Update() in the event handler.

However, the layer is now taking too long to update which was not noticeable before because it was not updating on the event handler.

The featurelayer is OnDemand with OnDemandCacheSize set to 1000.  It seems like even when zooming in the update is taking just as long as when fully zoomed out.  With OnDemand mode shouldn't it get faster if the map extent is reducing in size (zooming in)?

Does OnDemand only work with v3.0?
Current version is v2.4.  Have not upgraded yet.  There were some issues with the upgrade, and had to revert.
0 Kudos
by Anonymous User
Not applicable
Original User: dbroux

Does OnDemand only work with v3.0?
Current version is v2.4. Have not upgraded yet.


No OnDemand is also working with 2.4.

It seems like even when zooming in the update is taking just as long as when fully zoomed out. With OnDemand mode shouldn't it get faster if the map extent is reducing in size (zooming in)?


Yes OnDemand should be fast when the map extent is reducing in size. The problem is your call to Update that reinitialize the cache at each zoom.

To avoid that you might set MaxAllowableOffset to a fixed value and not to call Update when the map extent changes.
If you need MaxAllowableOffset depending on the zoom level you might create 2 (or more) feature layers with disjoint scale ranges and with a fixed MaxAllowableOffset depending on the scale range.
0 Kudos