ThinkGeo.com    |     Documentation    |     Premium Support

Issue with Google Map Projection

Hi,

In my application I am using multiple base maps like Normal map(with countries.shp shape file), Google and Openstreet

For matching all maps to be same i am using Google Map Projection for all by using following code…

Proj4Projection _proj = new Proj4Projection();
_proj.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
_proj.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); // (or)Proj4Projection.GetEpsgParametersString(3857);

ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(_sMapDataPath + “/MapData/MasterShapeFile/Countries02.shp”, _sMapDataPath + “/MapData/MasterShapeFile/Countries02.idx”, GeoFileReadWriteMode.Read, System.Text.Encoding.Default);
worldLayer.FeatureSource.Projection = _proj;
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoPen(GeoColor.FromArgb(Convert.ToInt32(_LandLineColor.Split(’,’)[0]), Convert.ToInt32(_LandLineColor.Split(’,’)[1]), Convert.ToInt32(_LandLineColor.Split(’,’)[2]), Convert.ToInt32(_LandLineColor.Split(’,’)[3])), 1F), new GeoSolidBrush(GeoColor.FromArgb(Convert.ToInt32(_LandColor.Split(’,’)[0]), Convert.ToInt32(_LandColor.Split(’,’)[1]), Convert.ToInt32(_LandColor.Split(’,’)[2]), Convert.ToInt32(_LandColor.Split(’,’)[3]))));
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay worldOverlay = (LayerOverlay)wfMap.CustomOverlays[“World Map”];
worldOverlay.Layers.Add(“worldLayer”, worldLayer);

But I am getting my normal map and other layers also ZIGZAG. Please look at in following pic.

I thought that this is an issue with Google map Projection… Please help me how can I resolve this…

Thanks,
Ashok

Hi Ashok,

If the ZIGZAG is point to this part , I think that’s maybe a problem to re-projection of your shape file. Because our re-projection for Google and OSM should be convert the whole tile image, it won’t get this shape.

Could you please try to remove other overlay and make sure that?

If it’s proved the issue of shape file and projection, please build a simple sample with your data, so we can see what’s the reason of it.

Regards,

Ethan

Hi Ethan,

I am facing this issue still… Earlier I was using Proj4Projection.GetEsriParametersString(54004) (Mercator).
My shapefile is working fine with this projection.

But now we are need to match our map with Google map. so we changed projection from 54004 to 3857(Google projection). this zigzag issue is coming… But with same projection in a small sample i am not facing this issue… Only in my Original application i m facing the issue…

Can u please give some solution to this. And please send me a latest Countries shape file you have.

Thanks,
Ashok

Hi Ashok,

Please try to reproduce that with our latest version dll in your simple sample.

Because convert between 3857 and 4326 is used most times in our map, so I think maybe the data or some code have problem.

And you can find our shape file in https://github.com/thinkgeo, please try to find that in HowDoISamples, I also don’t have the new version data for entire world.

Regards,

Ethan