Hello,
I’m currently using WMS and google overlays as a map background. I’m only using google because WMS is quite slow.
To show the overlay I use the following code:
string GoogleApiKey = "AIzaSyA_eRW037aBBKdL24vfx0FmYTqb6RWaD20";
//Sets the projection parameters to go from Geodetic (EPSG 4326) or decimal degrees to Google Map projection (Spherical Mercator).
switch (this.ExtentProjection)
{
case ExtentProjections.LatLong:
//need to change over to google's extent coordinate system
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
proj4.Open();
RectangleShape googleExtents = proj4.ConvertToExternalProjection(winformsMap1.CurrentExtent);
proj4.Close();
winformsMap1.MapUnit = GeographyUnit.Meter;
winformsMap1.CurrentExtent = googleExtents;
this.ExtentProjection = ExtentProjections.Google;
break;
case ExtentProjections.Google:
//shouldn't need to do anything...not sure how this case is possible
break;
}
string GoogleCacheLocation = MyUtilities.GetCropViewGoogleCacheFolder();
this.GoogleOverlay = new GoogleMapsOverlay(GoogleCacheLocation, "", GoogleApiKey);
this.GoogleOverlay.DrawingExceptionMode = DrawingExceptionMode.DrawException;
this.GoogleOverlay.MapType = GoogleMapsMapType.Hybrid;
this.GoogleOverlay.IsVisible = true;
This seems to work fine except that the maps have a bunch of watermarked strips on the images. Is there a way to make google return only one watermark per map? It seems ridiculous to have so many.
Thanks,
Mark