laptop and a wrench

Error

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

Última publicación: August 25, 2014 ArcGIS Runtime for Windows Mobile
Número de ID del error NIM038935
EnviadoOctober 1, 2008
Última modificaciónJune 5, 2024
Relacionado conArcGIS Runtime for Windows Mobile
Versión encontrada9.3
Sistema operativoWindows OS
Versión de sistema operativoXP
Versión corregidaN/A
EstadoFixed

Solución alternativa

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();

Pasos para reproducir

ID del error: NIM038935

Software:

  • ArcGIS Runtime for Windows Mobile

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga