ThinkGeo.com    |     Documentation    |     Premium Support

Beta 2 - Display of JPG and InMemoryFeatureLayer not working

Downloaded and installed new beta this morning.  My code is the same but now the following is not working:


Create the following Layer and add to StaticOverlay.Layer:s



 



GdiPlusRasterLayer siteLayout = new GdiPlusRasterLayer(MapPath("~/Images/Sites/SiteExample1.jpg"));

Add InMemoryFeatureLayer and add to StaticOverlay.Layers


This will display correctly. 


As soon as I create an InMemoryMakerOverlay and add to CustomOverlays, the other two layers dissappear from the MAP and only the MarkerOverlay is displayed. One thing to note is that I am using a ClassBreakMarkerStyle.

 



 




Tony, 
  
 We have made some changes on using Overlays in the latest Beta (3.0.131). 
  
 1, Map.BackgroundOverlay & Map.MarkerOverlay are added. BackgroundOverlay is supposed to be a base overlay, which is the bottom overlay of a map. MarkerOverlay makes it more convenient to add markers to a map.  
  
 2, In Last version (before 3.0.117), users can use StaticOverlay, DynamicOverlay with CustomOverlays collection together.  Now if you are using CustomOverlays, the StaticOverlay, DynamicOverlay, BackgroundOverlay and MarkerOverlay are all automatically disabled. This is one of our common pattern exists in Map Suite 3.0. For example, we also have DefaultStyle and CustomStyles. If the customStyles is not empty, all the defaultStyles are disabled.  
  
 So for your case, please use CustomOverlays only with the latest version (3.0.131). 
  
 Ben 


Okay, I need some help then, for the jpg that I need to display as the map background, how do I add it to the CustomOverlays Collection:



 


 


GdiPlusRasterLayer siteLayout = new GdiPlusRasterLayer(MapPath("~/Images/Sites/SiteExample1.jpg"



Map.CustomOverlays.Add(siteLayout); -> doesn't work?




Tony, 
  
 The code should be like this.  
  
 
GdiPlusRasterLayer gdiPlusRasterLayer = new GdiPlusRasterLayer(MapPath("~/Images/Sites/SiteExample1.jpg");
               
LayerOverlay layerOverLayer = new LayerOverlay();
layerOverLayer.Layers.Add(gdiPlusRasterLayer);
                
Map1.CustomOverlays.Add(layerOverLayer);

 
  
 Each Overlay will be a client part image, which can be composed of many layers.  
  
 Ben 


I have done as described and works.  I now have a performance related question.  I have added various LayerOverlays to the Maps CustomerOverlays collection (InMemoryFeatureLayers and InMemoryMarkerOveryLays).  I am attaching a jpg and the associated worldfile.  While in general the image does get displayed...it is extremely slow.  It is even slower as I zoom in to see the details of  the image.  In fact, it almost looks like it isn't working but if I wait long enough, 20 seconds, the image is displayed correctly.


I have read the paper on caching but seems to only apply to other Overlay types.  What, if anything, can I do to boost performance.? As a note I am using map units of meters.


Actuallly, I cannot upload the jpg file because it is too large: 716KB and the jgw is not an allowed file type.



It is very strange to take 20 seconds for a 716k jpg. Can you send the 2 files to me by sending to support@thinkgeo.com and ask to forward to Ben?  We will have a investigation with your data.  
  
 Ben.

Tony, 
  
 I got your files and recreated your problem. This is a bug in the current version (3.0.131), we will work on it and I think it will be solved in the next version. Thanks for pointing it out! 
  
 Ben,