laptop and a wrench

Bug

Map::SetExtent does not work consistently when the aspect ratio of the new extent differs from the map display's aspect ratio.

Zuletzt veröffentlicht: August 25, 2014 ArcGIS Runtime for Windows Mobile
Bug-ID-Nummer NIM038935
EingereichtOctober 1, 2008
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS Runtime for Windows Mobile
Gefunden in Version9.3
BetriebssystemWindows OS
BetriebssystemversionXP
Behoben in VersionN/A
StatusFixed

Workaround

For code to work in all aspect ratios try the following code- // Assign the new envelope to be the map's envelopedouble dWHAspect = Convert.ToDouble(theMap.Width) / Convert.ToDouble(theMap.Height);double dWHExtent = envelope.Width / envelope.Height;if (dWHAspect > dWHExtent){ // make width wider double dCenterX = envelope.MinX + (envelope.MaxX - envelope.MinX) / 2; double dCenterY = envelope.MinY + (envelope.MaxY - envelope.MinY) / 2; double dHeight = envelope.MaxY - envelope.MinY; double dWidth = dHeight * dWHAspect; envelope = new Envelope(new Coordinate(dCenterX, dCenterY), dWidth, dHeight);}else{ // make height wider double dCenterX = envelope.MinX + (envelope.MaxX - envelope.MinX)/2; double dCenterY = envelope.MinY + (envelope.MaxY - envelope.MinY) / 2; double dWidth = envelope.MaxX - envelope.MinX; double dHeight = dWidth / dWHAspect; envelope = new Envelope(new Coordinate(dCenterX, dCenterY), dWidth, dHeight);}envelope.Resize(1.5);theMap.SetExtent(envelope);theMap.Invalidate();

Schritte zur Reproduzierung

Bug-ID: NIM038935

Software:

  • ArcGIS Runtime for Windows Mobile

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln