Hi Team,
Multiple google banners are displayed on maps looks annoying to customers. Could you please guide me how to fix the issue.
Attached screen shot for reference:
Sample code here:
using (var googleOverlay = new GoogleMapsOverlay(Properties.Settings.Default.GoogleClientID, Properties.Settings.Default.GooglePrivateKey)
{
MapType = GoogleMapsMapType.Hybrid,
TileType = TileType.MultipleTile,
DrawingExceptionMode = DrawingExceptionMode.DrawException,
TransitionEffect = TransitionEffect.Stretch,
})
{
googleOverlay.TileCache = new FileBitmapTileCache(tileCacheFolder, “googleMap”);
googleOverlay.TileHeight = 512;
googleOverlay.TileWidth = 512;
googleOverlay.SendingWebRequest += googleOverlay_SendingWebRequest;
googleOverlay.DrawingException += (sender, e) => LogHost.Default.ErrorException(e.Exception.ToString(), e.Exception);
googleOverlay.DrawnException += (sender, e) => LogHost.Default.ErrorException(e.Exception.ToString(), e.Exception);
Map.Overlays.Add(BACKGROUND_OVERLAY, googleOverlay);
}
Below code is for cashing
public void SaveMapAsImage(BetterWpfMap map, string fileName, ProposalLayers pdfZone, Proposal proposal)
{
try
{
var engine = new MapEngine();
var tileCacheFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
var googleLayer = new GoogleMapsLayer(tileCacheFolder, Properties.Settings.Default.GoogleClientID, Properties.Settings.Default.GooglePrivateKey)
{
MapType = GoogleMapsMapType.Hybrid,
DrawingExceptionMode = DrawingExceptionMode.DrawException
};
engine.DynamicLayers.Add(googleLayer);
try
{
using (var img = new Bitmap(1000, 700))
{
SaveMapAsImage(map, fileName, proposal, pdfZone, engine, img);
}
}
catch (Exception e)
{
LogHost.Default.ErrorException(e.ToString(), e);
}
}
catch (Exception e)
{
LogHost.Default.ErrorException(“Error generating map image.”, e);
}
}
Thanks,
Ravi