i am very confused about map extent in thinkgeo. i give map.currentExtent a value,but the two are not equal!why?
Rectangle fullExtent = new RectangleShape(103.58, 1.50, 104.11, 1.17);
WpfMap map = new WpfMap();
Proj4Projection proj4Projection = new Proj4Projection();
proj4Projection.InternalProjectionParametersString = Proj4Projection.GetWgs84ParametersString();
proj4Projection.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
proj4Projection.Open();
RectangleShape newExtent = (RectangleShape)proj4Projection.ConvertToExternalProjection(fullExtent);
proj4Projection.Close();
map.MapUnit = GeographyUnit.Meter;
map.CurrentExtent = newExtent;
i debug the code,the newExtent is (11530472.8563673,166998.313752922,11589472.1964877,130252.85691625),and the map.CurrentExtent is (11559972.5214225,148625.585339586,11559972.5214325,148625.585329586).The former is the whole Singapore and the latter is only a street in Singapore!And the two’s center point is the same!
Thanks!
About map extent
Hi Channing,
The reason is that Map Suite does some adjustments after
assigning an extent to map, based on its screen viewport (in pixel), thus to
make sure it fits the viewport width/height ratio and pre-defined fixed zoom
levels. To clarify it, please check
detail as following:
1. Adjust the assigned current extent based on the
viewport width/height ration to make sure the map extent ratio is same to the
ratio of the screen viewport ratio, otherwise, the map image may be resized without
maintaining aspect ratio.
2. As we knew, the Map Suite maintain a predefined
zoom level set in the map object, all the drawing extent will be adjusted after
snapping these zoom levels to make sure they can match each other.
Hope it helps.
Thanks,
Johnny