ThinkGeo.com    |     Documentation    |     Premium Support

Getting error when using BingMapOverlay

Hi,

I am using BingMapLayer on myApplication and I am faced with two problems :



1. why bing word repeat on map even though I use the basicmapKey ?

2. My Code looks like below and in test works fine:

==============================================================



winformsMap1.MapUnit = GeographyUnit.Meter;
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));
var layer = new ShapeFileFeatureLayer(@"ShpFiles\Cardiff_Boundary_region.shp");
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoPen(GeoColor.SimpleColors.Black),
              new GeoSolidBrush(GeoColor.SimpleColors.Transparent));
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
 
var staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("layer", layer);
winformsMap1.Overlays.Add(staticOverlay);
  
var projection = new Proj4Projection
{
InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(27700),
ExternalProjectionParametersString = Proj4Projection.GetBingMapParametersString()
};
 
layer.Open();
var t = layer.GetBoundingBox();
layer.FeatureSource.Projection = projection;
projection.Open();
winformsMap1.CurrentExtent = projection.ConvertToExternalProjection(t);
projection.Close();
layer.Close();
 
 
var bingMapsOverlay = new MyBingMapsOverlay("Au9yN0FUHyp5zAoh0zWBjbw81-eSeaiH2J_zTFiCWQ0OYlhYX9i17jR9cnBhQFLJ");
winformsMap1.Overlays.Insert(0, bingMapsOverlay);
 
winformsMap1.Refresh();

==============================================================

but when I select multiple files and run code again and again , I am getting following errors :
//system.net.webexception: the underlying connection was closed: the connection was closed unexpectedly.
//System.Net.Sockets.SocketException: "An existing connection was forcibly closed by the remote host"


Can anyone help me on these problems?
thanks



Hi Maryam, 



1. Could you attach a screen shot for repeat bing word? 

2. Do you meant you change the tile mode to multiply tiles? 



Regards, 



Don



Hi ,

For my first question , i have map lookes like below : 



 



=========================================



and for second question , on my form i have a text box for shape file and a button to show selected file from textBox .

when i change the map file on my text box and press button , for first time or second it works fine . but when i use it for multiple times and Immediately after the previous map , sometimes i get errors as previously mentioned .



thanks for your help.






Hi Maryam, 
  
 Thanks for your further information,  
  
 For the first problem, I am sorry to say that with the newest dll(7.0.425.0) the problem didn’t show up on our end, here is a test video from our end for your information: screencast.com/t/SpHe7TiWy. would you please get the latest dll and try it again, if the problem is still there, would you please provide us your dll version? 
  
 For the second problem, would you please provide us the code in the “button”? or if possible, a self-contained sample will be highly appreciated. 
  
 waiting for your further information. 
  
 Summer

Hi,



Thanks for your response .



I attach a clear sample . 

To reproduce connection error I try to Zoom and Pan (especially when map is not loaded completely) consecutive but maybe it depends on speed of internet connection .



===========================================

3. And also i have another important problem . when i load my shapeFile,lines are not exactly match with map .







thanks for your help.

Hi Maryam,  
  
 It looks your sample is under VS2008, so you are using map suite 6.0? If so, could you please update to use our latest 7.0 version, which should have fixed the Bing icon issue. 
  
 For you second question, you convert projection from 27700 to Bing map projection, I am not sure whether your data is under projection 27700, please make sure that. 
  
 Regards, 
  
 Don