I’m trying to set CurrentExtent on a map.
I load the map using serveroverlay
then I get the boundingbox via service, and set CurrentExtent to the result.
but it always throwing exception. even when I set CurrentExtent with static or constant value.
I’ve done this.
Map.CurrentExtent = new RectangleShape(bounding box result); // doesn’t work
Map.CurrentExtent = new RectangleShape(1,2,3,4); // doesn’t work
the exception is below
"
System.InvalidOperationException was caught
Message=This method will return too many cells that might cause performance problem. Please using GetIntersectingRowColumnRange method instead.
StackTrace:
at ThinkGeo.MapSuite.SilverlightCore.Matrix.GetIntersectingCells(RectangleShape worldExtent)
at ThinkGeo.MapSuite.SilverlightEdition.WmsOverlay.0xM=(Canvas 1BM=, RectangleShape 1RM=, Int32 1hM=, Int32 1xM=, Int32 2BM=, Int32 2RM=, Collection`1 2hM=)
at ThinkGeo.MapSuite.SilverlightEdition.WmsOverlay.DrawCore(RectangleShape worldExtent)
at ThinkGeo.MapSuite.SilverlightEdition.WmsOverlay.Draw(RectangleShape worldExtent, OverlayDrawType overlayDrawType)
at ThinkGeo.MapSuite.SilverlightEdition.Map.IRQ=(RectangleShape KBQ=, OverlayDrawType KRQ=)
at ThinkGeo.MapSuite.SilverlightEdition.Map.set_CurrentExtent(RectangleShape value)
at iProTax.SmartMap.Views.PageHome.SmartMapServiceClient_LoadBoundingBoxCompleted(Object sender, GetBoundingBoxPetaCompletedEventArgs e)
InnerException:
"
I’m using MapSuite Silverlight v 7
it was work without exception when i use MapSuite Silverlight v 6.
Thanks.
Set CurrentExtent on a map throw exception
Hi Syarif,
Thanks for your post, we have tried “Map.CurrentExtent = new RectangleShape(1,2,3,4);” but the problem didn’t show up, would you please give us more code to test or if possible a “self-contained” sample is highly appreciated.
Waiting for your further information
Summer
Hi Syarief,
Thanks for your sample, the problem has been found, would you please change “SmartMap.MapUnit = GeographyUnit.DecimalDegree;” in “Public MainPage()” in “MainPage.xaml.cn” to “SmartMap.MapUnit = GeographyUnit.Meter;”, following is a result picture after the change.
if you have any more question , please feel free to let us know.Hope it helps
Hope it helps
Summer
Hi Summer,
Thanks for your help.
May I know the reason why? because when I use v6 it runs well.
Hi Syarief,
Please comprehend it like this: If a data itself is in Meter, but it is displayed under “SmartMap.MapUnit = GeographyUnit.DecimalDegree” it will make a confusion in tileMatrix calculation, In the past we didn’t check the Confusion. but now we have made amemdment to check this confusion. Actually the data in the sample is in meter, so it should be displayed under “SmartMap.MapUnit = GeographyUnit.Meter”. If it needs to be displayed under decimaldegree, then the projection convertion is needed with following sample code:
Proj4Projection proj1 = new Proj4Projection();
proj1.InternalProjectionParameters = Proj4Projection.GetGoogleMapParametersString(); //if data is under GoogleProjection
proj1.ExternalProjectionParameters = Proj4Projection.GetEpsgParameters(4326);
proj1.Open();
tabFeatureLayer.FeatureSource.Projection=proj1;
Hope it helps
Summer
OK, I got it.
Thanks Summer.
Hi Syarief,
You are always welcome,if you have any more question , please feel free to let us know.
Best Regards
Summer