Hello,
I'm trying to create a bitmap from my map with WMSOverlay, but it isn't rendered on the picture I get. Can I have the result I expect or is it impossible?
Thank you vrey much,
André
Hello,
I'm trying to create a bitmap from my map with WMSOverlay, but it isn't rendered on the picture I get. Can I have the result I expect or is it impossible?
Thank you vrey much,
André
Andre Francois,
It sounds like that what you want to do is get the bitmap from the extent you have on your map. We have a sample in the Code Community that shows how to get the bitmap of the current extent regardless of what is on the map, WMSOverlay, shapefiles, dynamic data, satellite images etc. The sample is Current Extent to Bitmap wiki.thinkgeo.com/wiki/Map_Suite_We..._to_Bitmap. It also shows you how to get the world file for the bitmap but you might not be interested in that part. The sample is in the Services edition but the relevant code for getting the bitmap can be applied to all editions of Map Suite. Thank you.
Val,
thank you for your answer.
I use MapSuite Web edition, and I don't understand how to put all the overlays and layers (include wmsOverlay, googleoverlay,...)into the MapEngine.
Thank you,
André
Andre Francois,
I think I misguided you pointing you to the sample Current Extent to Bitmap because it is using another version of Map Suite. Did you see the function GetBitmap from Map. It reruns a bitmap and it is getting the picture of whatever is on the current extent of the map, wmsoverlay, google map overlay etc. I think this is what you need and I apologize for not mentioning this earlier.
Val,
thank you again! And Happy new year!
I tried GetBitMap() with MapSuite ASP.NET version 5.5, but some overlays are not displayed on the bitmap, and wmsoverlay are not anymore. Are you sure all type of overlay can be printed?
Best regards,
André-François
Andre Francois,
I spoke too fast in my last response. The GetBitmap is NOT going to get whatever is on the map in the WEB edition. It is not going to get the GoogleMap, BingMap and wms OVERLAYS, but it is going to get the GoogleMap, BingMap, OpenStreetMap and wms LAYERS. You see in our API, we amke the distinction between OVERLAYS and LAYERS . So we have GoogleOverlay, BingMapsOverlay, OpenStreetMapOverlay and WmsOverlay for OVERLAYS and we have GoogleMapsLayer, BingMapsLayer, OpenStreetMapLayer and WmsRasterLayer for LAYERS. Using an overlay, it is going to be more efficient because it is going to use drawing techniques specific to the edition (web, wpf , silverlight etc). When using layers it is generic but it comes with the advantage that it is going to show in the image from GetBitmap. So, for getting the image with GetBitmap, I suggest you create code to use WmsRasterLayer instead of WmsOverlay. I hope that this helps.
Val,
thank you! Now I really know the diffrence between the WMSOverlays and WMSRasterLayer, and I could work in that way to fullfil my goals.
Best regards,
André-François
VaL,
We have the same problem, the GetBitMap does not get the overlay, only the underlying map. Can you suggest a method we can use to get both? We do not use WMSRasterLayer nor WMSOverlays. We are currently on WebEdition 5.5.
Thanks,
Al Vigil
Al,
As I explained to Andre Francois in my earlier response, the Overlay type of BingMap, Google map, Open Street Map and Wms has been optimized for each version of Map Suite for best performance taking advantage of each specific technology for Web, SilverLight, Wpf etc but it comes with the inconvenience of not being captured by the GetBitmap function. This is an architectural limitation that is going to require you to use the layer type for those kind of maps.
Val,
We do not use any of these services. Our maps are generated from our own shape files. For our case, what do you suggest?
Al Vigil
Al,
If you are not using any of those services (Bing map, Google Map, Open Street Map, WMS), then you can simply use ShapeFileFeatureLayer add it to the CustomOverlays collection and you get use the GetBitmap function and you should see your shapefile. You can see the code below. It comes from the sample "Load A ShapeFileFeatureLayer" from the "How Do I" samples.
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/SampleData/world/cntry02.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.IsBaseOverlay = false;
staticOverlay.Layers.Add(worldLayer);
Map1.CustomOverlays.Add(staticOverlay);
I have the same problem. I tried LAYER instead of OVERLAY, It works but, how do I set map type for the OpenStreetMapLayer? and how do I set key of bing map for the BingMapsLayer?
Hi Hotter,
For question on the map type of OpenStreetMapLayer, I think we can discuss it in a pure thread thinkgeo.com/forums/MapSuite…fault.aspx
As for the key of BingMapsLayer, I think you mean the ApplicationID property, assign your key for this property should make the layer work fine. Please let us know if anything I misunderstood.
Thanks,
Troy