Hello,
I am using the Google map's layer in my mapping application and I am having some trouble understanding how projections work. I followed the sample application GpsToGoogleDesktop code.thinkgeo.com/projects/show/gpstogoogledesktop. And I somewhat understand how to project features onto the google map using the Proj4Projection. But I'm having trouble getting a shapefile to be displayed or projected where i set my current extent to.
For example i set my map extent to be a view of Michigan using:
//Sets the projection parameters to go from Geodetic (EPSG 4326) or decimal degrees to Google Map projection (Spherical Mercator).
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString( 4326 );
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
//Values in Longitude and Latitude., For middle of MI
double Longitude = -84.772339;
double Latitude = 43.598693;
proj4.Open();
Vertex vertex = proj4.ConvertToExternalProjection(Longitude, Latitude);
proj4.Close();
double extendWidth = 260000;
double extendHeight = 150000;
winformsMap1.CurrentExtent = new RectangleShape( (vertex.X - extendWidth), (vertex.Y + extendHeight), (vertex.X + extendWidth), (vertex.Y - extendHeight) );
winformsMap1.Refresh();
But with the other shapefile i am trying to display, it ends up being placed in the ocean near Africa. Is there an example or could you further explain to me how i need to project other shapefiles onto the google map?
thanks.
--Andy