ThinkGeo.com    |     Documentation    |     Premium Support

Auto Height,Width and Value Styles

Hi Guys,


Couple of questions:-


1.  Can't seem to get the control to fill its container, seemingly you have to set the width and height.  Am I missing something?


2. ValueStyles do not appear to be supported is this an ommision?


Regards


John



Hi John, 
  
 We don’t support both of them in the existing version. 
  
 1, We need to know the map’s width and height properties in order to calculate the scale and extents of the map. But actually in Canvas’s loaded life circle, we can’t find the actual width and height. In this case, the function to set the current extent such as ZoomTo, CurrentExtent you are using in the loaded function can’t work right. We are trying to improving it. 
  
 2, The ValueStyle is not supported in this version of client API, but it still supports in the server rendering, we plan to add it in the upcoming version. 
  
 If you have any questions please let me know. 
  
 Thanks, 
  
 Howard









v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}






Hi Howard,


Thanks for the response.


Appreciate the problems with width and height.


We obviously only have the demo code that comes with the beta and get evaluation expired errors when we try and run the demo code locally see below.


If we could load maps from server side how do you apply value styles?


Regards


John


 


Server Error in '/' Application. 


  




The evaluation has expired.  Please contact ThinkGeo for purchasing option or an extension to the trial. 


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 



Exception Details: System.InvalidOperationException: The evaluation has expired.  Please contact ThinkGeo for purchasing option or an extension to the trial.



Source Error: 



    
        
            
            

 


            

Line 18:                   SilverlightMapConnector1.MapUnit = GeographyUnit.DecimalDegree;


            

Line 19: 


            

Line 20:                   ShapeFileFeatureLayer worldLayer = new   ShapeFileFeatureLayer(MapPath("~/app_data/cntry02.shp"));


            

Line 21:                 worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle   = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228),   GeoColor.FromArgb(255, 218, 193, 163), 1);


            

Line 22:                   worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;


            
        
    

 








Hi John,



Could you tell me what the language are you using on your machine? Some customers report this issue, but we can’t recreate it.



On the server side, it’s the same way to use ValueStyle as web edition, please see the following code for server-side.

SilverlightMapConnector1.MapUnit = GeographyUnit.DecimalDegree;
ValueItem valueItem1 = new ValueItem("China", AreaStyles.Country1);
ValueItem valueItem2 = new ValueItem("Canada", AreaStyles.County2);
ValueItem valueItem3 = new ValueItem("Australia", AreaStyles.Evergreen1);

ValueStyle valueStlyle = new ValueStyle();
valueStlyle.ColumnName = "CNTRY_NAME";
valueStlyle.ValueItems.Add(valueItem1);
valueStlyle.ValueItems.Add(valueItem2);
valueStlyle.ValueItems.Add(valueItem3);

ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/app_data/cntry02.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStlyle);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

ServerLayerOverlay layerOverlay = new ServerLayerOverlay("NativeServer");
layerOverlay.Layers.Add(worldLayer);

SilverlightMapConnector1.ServerLayerOverlays.Add(layerOverlay);

Thanks for reporting,



Howard



Hi Howard,


Machine is Windows Vista Ultimate SP2, language English ( United Kingdom ) Silverlight 2, code/data/web located on Drive D


Thanks for the code, can't try it at the moment with the evaluation expired problem.


Regards


John


 



Hi John, 
  
 I tested in XP, 2003, and Vista X86, but can’t recreate your issue, it seems there is some issue during the installation of Map Suite Silverlight Edition.  
  
 Please run “C:\Program Files\ThinkGeo\Map Suite Silverlight Evaluation Edition 3.0 (BETA)\Miscellaneous\Map Suite Registration Builder\MapSuiteRegistrationBuilder.exe”, it’ll generate a request license key, please send it to support@thinkgeo.com, we will lengthen the expiration date for you.  
  
 If you have any queries, please let us know. 
  
 Thanks, 
  
 Howard