ThinkGeo.com    |     Documentation    |     Premium Support

Wider roads when zooming in

i wonder is there any way when user zooming toward level 20, the roads get wider and wider, also the road labels also get wider and wider? i tried this but its not what i want:




expresswayLayer.ZoomLevelSet.ZoomLevel17.DefaultLineStyle = LineStyles.LocalRoad4;
expresswayLayer.ZoomLevelSet.ZoomLevel18.DefaultLineStyle = LineStyles.LocalRoad3;
expresswayLayer.ZoomLevelSet.ZoomLevel19.DefaultLineStyle = LineStyles.LocalRoad2;
expresswayLayer.ZoomLevelSet.ZoomLevel20.DefaultLineStyle = LineStyles.LocalRoad1;


 



Ric, I’m sure someone will come up with something more elegant, but here’s a sample of having two different line widths and font sizes which switch in based on zoom level.  Some of the sizes are intentionally distorted for visibility purposes.  The TextLineSegmentRatio is something I often need to do because of the way our data is sliced up.  This approach might be convoluted if you have many different settings but I’d think putting the settings and styles in arrays or lists and looping might make it easier. 
  
             LineStyle line0 = LineStyles.Highway4; 
             line0.OuterPen.Color = GeoColor.SimpleColors.Green; 
             line0.OuterPen.Width = 4; 
             TextStyle text0 = TextStyles.Highway1(“MAP_NAME”); 
             text0.TextLineSegmentRatio = 100; 
             text0.TextSolidBrush.Color = GeoColor.SimpleColors.Green; 
             text0.Font = new GeoFont(“Arial”, 12); 
  
             LineStyle line1 = LineStyles.Highway4; 
             line1.OuterPen.Color = GeoColor.SimpleColors.Red; 
             line1.OuterPen.Width = 12; 
             TextStyle text1 = TextStyles.Highway1(“MAP_NAME”); 
             text1.TextSolidBrush = new GeoSolidBrush(GeoColor.SimpleColors.Red); 
             text1.TextLineSegmentRatio = 100; 
             text1.Font = new GeoFont(“Arial”, 40); 
  
             roads.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = line0; 
             roads.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = text0; 
             roads.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level10; 
  
             roads.ZoomLevelSet.ZoomLevel11.DefaultLineStyle = line1; 
             roads.ZoomLevelSet.ZoomLevel11.DefaultTextStyle = text1; 
             roads.ZoomLevelSet.ZoomLevel11.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; 
  
 …the rest is routine… 
  
 Allen 





 


Ric,


I think this is what you need,  the ScalingLineStyle. Please have a look at this post for detail.


gis.thinkgeo.com/Support/Dis...fault.aspx


Thanks,


Ben