VDS Technologies

 

Google Maps and esri shapfile

6/7/2012 12:51:31 PM
Total Posts 14

Google Maps and esri shapfile

I have  problem I use Esri shapefile in my application and using Google maps as background And I prepare zoom to feature function , after I search on the feature(make filter ), then I click on the button to zoom to this feature The zoom go to (0,0) point ... If I remove Google maps from the background it's work ok and if I used Google map is go to 0,0 point what is the problem.. ____________________________________________________________________________________________________ i need best practice solution,,,, the all sample note include google map and esri shapefile>>>> is this problem in aspmap or on google maps,,,

 

i am using aspmap 4.6.2

6/7/2012 2:25:00 PM
MVP
Total Posts 323

Re: Google Maps and esri shapfile

If the coordinate system of the shapefile differs from the Google Map's coordinate system, the coordinates must be transformed to the coordinate system of Google Maps. For example, if the coordinate system of the shapefile is GCS_WGS1984 -

For points:

map.CenterAt(map.CoordinateSystem.FromWgs84(-101.95, 39.85));

For extents:

map.Extent = map.CoordinateSystem.FromWgs84(shapefileLayer.Extent);

map.Extent = map.CoordinateSystem.FromWgs84(recordset.Shape.Extent);