ThinkGeo.com    |     Documentation    |     Premium Support

Projection to Openstreet map and Google map

Hi,

I am using Thinkgeo Web Edition, there i am using different base maps like Openstreet map, Google map and Normal (Using Countries.shp shape files).

Some times I wanted to display my data in different projections based on place. I knew that I can do projection for Normal(Countries.shp file),

But is it possible to do same for Openstreetmap , Google maps… If so pls send me sample code.

Thanks,
Ashok

Hi Ashok,

The GoogleOverlay and OpenStreetMapOverlay don’t support re-project.

But the GoogleMapsLayer and OpenStreetMapLayer should support it, the API looks like this:

                Proj4Projection proj4 = new Proj4Projection();
            proj4.InternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
            proj4.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);

            GoogleMapsLayer google;
            google.Open();
            google.ProjectionFromSphericalMercator = proj4;

            OpenStreetMapLayer osm;
            osm.Open();
            osm.ProjectionFromSphericalMercator = proj4;

But we cannot make sure the tile looks so well because it’s reproject the tile image.

Regards,

Ethan