Is there a way to translating between resolution and scale in the ArcGIS Silverlight API?
I am dynamically adding a Feature Layer to my map which should have a Min Scale value of 10,000. The feature layer object has a setting for Minimum Resolution, but nothing for Scale values.
Does anyone know how I can set the Feature Layer to only show data below that scale?
-
Are you willing to assume a dpi for your display? What if someone is using a projector?Kirk Kuykendall– Kirk Kuykendall2011年06月20日 21:00:50 +00:00Commented Jun 20, 2011 at 21:00
-
Yes, I'd be willing to assume a DPI.Britt Wescott– Britt Wescott2011年06月20日 21:05:21 +00:00Commented Jun 20, 2011 at 21:05
2 Answers 2
In your code-behind, you can get your Map's scale and resolution, and divide them to get the constant between them. Then, just set the minimum resolution for the FeatureLayer, based on that.
vb.net:
'assuming variable MyMap as ESRI.ArcGIS.Client.Map
Dim myFeatureLayer as New FeatureLayer() With { _
...
.MinimumResolution = 10000 * MyMap.Scale / MyMap.Resolution _
}
LayerInfo mfinfo = (map1.Layers["MFStock"] as ArcGISDynamicMapServiceLayer).Layers[1] as LayerInfo;
mfinfo.MaxScale = 100000;