1

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?

2
  • Are you willing to assume a dpi for your display? What if someone is using a projector? Jun 20, 2011 at 21:00
  • Yes, I'd be willing to assume a DPI. Jun 20, 2011 at 21:05

2 Answers 2

1

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 _
}
0
LayerInfo mfinfo = (map1.Layers["MFStock"] as ArcGISDynamicMapServiceLayer).Layers[1] as LayerInfo;
        mfinfo.MaxScale = 100000;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.