ThinkGeo.com    |     Documentation    |     Premium Support

Migration Guide from MapSuite 2.0

Hello,


I was curious if there was any sort of reference material available to assist in the migration of MapSuite 2.0 API based applications to the new 3.0 API.  I have begun to look at the level of effort we are looking at to migrate our MapSuite 2.0 based app and as I start to dig into it I quite frankly do not even know where to begin.  It seems that many of the fundamental programming models and paradigms used in the 2.0 module are completely different in 3.0.  It would be great to have some guidance on how these primary core functionalities are now utilized.  Even the samples are pretty limited in what they actually demonstrate, so I am scratching my head a bit here on how to proceed.


Some of the core functions we leverage heavily in 2.0 include:


-Custom Zoom Levels


-Custom Fields


-SymbolValueRenderers


-SymbolRenderer


-PointSymbol, LineSymbol and AreaSymbols


-SelectSymbols


... and probably a few more that will come up as we dig deeper.  If such a migration manual is not available, would it be possible to get some guidance on the above 2.0 features and what we should be looking at in the 3.0 API that replaces them?


Thanks,


Tyler


 


-Selecting



Tyler, 
  
 We are very glad to hear you are going to Map Suite 3.x. You will like it as it is a more powerful and extendable platform.  
  
 This is the quick reference on the objects which you mentioned: 
 Custom Zoom Levels      --> shapeLayer.ZoomLevelSet.CustomZoomLevels 
 SymbolValueRenderers  --> ValueStyle 
 PointSymbol                  --> PointStyle 
 LineSymbol                   --> LineStyle 
 AreaSymbols                  --> AreaStyle 
  
 Following articles might help you to quickly get started with 3.x.  
 Getting Started  
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/20/aft/4804/afv/topic/Default.aspx  
  
 Developer Blog 
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/afv/topicsview/aff/16/Default.aspx 
  
 IntroToMapSuiteDesktop3QA  
 download.thinkgeo.com/Webinars/IntroToMapSuiteDesktop3QA.doc  
  
 Video: Intro to Map Suite Desktop Edition 3.0 
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/16/aft/5011/afv/topic/Default.aspx 
  
 Where did MapShapes go in 3.0? 
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/16/aft/4921/afv/topic/Default.aspx 
  
 Also you can share your questions, suggestions or any interesting things you found / created here and we are willing to help. 
  
 Thanks, 
 ThinkGeo Support 


Thanks Lee, 
  
 This helped me move forward.  I ran into a few more topics where I could use some direction on how they translate from 2.x to 3.x: 
  
 -In 2.x in the CustomZoomLevels, it was possible to specify an UpperExtent and LowerExtent for the layer to be visible.  Is there a way to translate this to the new ZoomLevel object?  I see that it accepts a scale parameter, but I don’t understand how to set a “band” of visibility for a layer. 
  
 -What is comparable in 3.x for the 2.x SymbolRenderer object? 
  
 -What is comparable in 3.x for the 2.x FeatureInfo object? 
  
 -Is the Geocoding functionality similar in 3.x as it is in 2.x?  Is there some sample code from this? 
  
 -Is the Google Maps functionality up and running in 3.x desktop?  
  
 Best, 
 Tyler

Tyler, 
  
 Every ZoomLevel is a range instead of a point, it has an UpperScale and LowerScale which presents the range the layer is visible. Here is an example how it works. 
  
 Let’s say I have a ZoomLevelSet with 3 ZoomLevels, the scale of the 3 zoomLevels are 100, 500, 1000 separately. That means if the current Scale is between 300 ((100+500)/2) and 750((500 + 1000)/ 2), it belongs to ZoomLevel2. if it is less than 300, it’s ZoomLevel1, if it is bigger than 750, it’s within ZoomLevel3. You can see from this sample that ZoomLevel’s scale makes sense only when it is within a ZoomLevelSet. Hope it is helpful for you to understand the Zoom Level extents. 
    
 Here are the answers for your other questions. 
 1, we are using Style (AreaStyle/PointStyle/LineStyle) for the renders. We have a lot of built-in styles so you can just pick one and use it. Also, you can use CustomStyles for some advanced scenarios like using multi styles for the same feature; it’s usage is kind of the SymbolRender in 2.x. 
  
 2, Feature in 3.x is kind of FeatureInfo in 2.x. The shape and the tabular data can be held in a Feature.  
  
 3, You mean the built in GeoCode? We don’t have it in the Desktop Edition in 3.x, but we will update our GeoCode product which will be much more extensible and powerful, it will be available maybe 3 months from now. 
  
 4, Yes, you can use Google Map in Desktop by the class GoogleMapOverlay. 
  
 Let me know if you have any issues. 
  
 Thanks, 
  
 Ben 


Thanks Ben, 
  
 So just to clarify a little further on the scale using some examples: 
  
 -If I have a layer I want only to be visible between 0 and 1000 (and hidden at any scale greater than 1000), I would have  a single ZoomLevel with a scale value of 1000 
  
 -If I have a layer I want visible betwen 500 and 1000 (but at no other scale), I would have two ZoomLevels: One with a scale of 500 and one with a scale of 1000. 
  
 Is that a correct assessment? 
  
 Thanks, 
 Tyler

Tyler, 
  
 -If I have a layer I want only to be visible between 0 and 1000 (and hidden at any scale greater than 1000), I would have a single ZoomLevel with a scale value of 1000  
 - You need to create two ZoomLevels, one has the scale of 500 and the other has 1500. The style needs to be set in the first (with the scale of 500) ZoomLevel. 
  
 -If I have a layer I want visible betwen 500 and 1000 (but at no other scale), I would have two ZoomLevels: One with a scale of 500 and one with a scale of 1000.  
 - You need three ZoomLevels, 1st one has the scale of 250, 2nd one is 750 and the 3rd one is 1250. You need to set the style for the 2nd ZoomLevel 
  
 This is for FeatureLayer. For RasterLayer though, you can directly set the UpperThreshold and LowerThreshold for a layer. That’s because usually raster layer is just for background and we only need to set its visible or not, so it’s simple. FeatureLayer usually represents features which varies a lot when you keep zooming in/out, so a ZoomLevelSet is required. 
  
 Thanks, 
  
 Ben 


Thanks Ben, that clarifies things for me.   
  
 I’ve run into another problem.  I have ported most of our code over from 2.x now and am testing functionality.  The problem I am having is when I try to apply Styles for a ShapeFileFeatureLayer.  I have loaded the layer from the file and added it to the StaticOverlays of the map.  In order to apply the appropriate style (ie: PointStyle vs. LineStyle) I call the GetShapeFileType for the ShapeFileFeatureLayer.  However, when I attempt to call this method, I get the following exception: 
  
 “The Layer must be opened before you can perform this method.” 
  
 Am I missing a step somewhere?  Any insight would be greatly appreciated. 
  
 Thanks, 
 Tyler

Tyler, 
 Thanks for your post. 
  
 I think one change Ben not mentioned above is about the Open/Close mode in 3.x. Every time you call the API in a featureSource/ FeatureLayer/ Projection, you have to call the ShapeFileFeatureSource.Open() first, after you call the API you want, just call the close. 
  
 The paten is as following: 
 ShapeFileFeatureSource.Open() 
 Try 
 { 
    // Do the stuff like Spatial Query etc 
 } 
 Finally 
 { 
 ShapeFileFeatureSource.Close(); 
 } 
  
 Any problem just like me knows. 
 Thanks. 
 Yale