I use a piece of code for dynamically loading feature layers. Either before or after the loading, I need to set the Data Frame in Decimal Degrees. Is there such a piece of code that can set / change the Data Frame's setting? Thanks.
Ken:
Thanks for your response. I revised my program. But after the feature layers are loaded, the frame still shows feet as the unit. Besides, the returned values (Calculated central X & Y) are still in feet. Any new idea? Thanks.
I believe you're overthinking it. Try this
m_Map = m_mxDoc.FocusMap;
m_Map.DistanceUnits = esriDecimalDegrees
Thanks for your hint. Below is the code I have. But I can't QI to Decimal Degree. What's wrong in my code? Thanks.
m_mxDoc = (IMxDocument)app.Document; //m_app.Document; m_Map = m_mxDoc.FocusMap; m_activeView = (IActiveView)m_Map;
ISpatialReference spRef = m_Map.SpatialReference; IProjectedCoordinateSystem pProjectedCoordinateSystem = spRef as IProjectedCoordinateSystem; ILinearUnit pLinearUnit = pProjectedCoordinateSystem.CoordinateUnit;
Use the IMap.DistanceUnits property
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.