ThinkGeo.com    |     Documentation    |     Premium Support

LatLng to Google meter?

Hi,


I have gps datas to be shown in our map file and also to be shown in google or yahoo maps. 


When i create the map by using shp files the markers located in right coordinates. But if i change map type to google map or yahoo map, the markers pointed in a wrong location. I changed MapUnit to GeographyUnit.DecimalDegree it doesnt work.


I think i have to convert the coordinate information from gps coordinates to meters. What are your suggestions for my problem?


MY GPS DATA

27,5025981173173 40,9769462800647


GOOGLE MAP APRX LOCATION

5008765 3059621



Are you trying to convert the GPS point to Google points so you can use them on the GoogleMapsLayer? 
  
 What datum is your GPS data? ie. WGS84 etc. 
  
 I will post a quick sample shortly

Yes i want to convert google coordinates.  
  
 DATUM FOR WGS84 
 Latitude 40,9769462800647 
 Longitude 27,5025981173173  
  


Give this a whirl, (the codes for the projection types is in the install folder of MapSuite under Documentation\Projections


Dim WGS84toGoogle As New Proj4Projection(Proj4Projection.GetEsriParametersString(4326), Proj4Projection.GetGoogleMapParametersString)
        WGS84toGoogle.Open()
        WGS84toGoogle.ConvertToExternalProjection(27.5025981173173, 40.9769462800647)



if your shapefile is in WGS84 you can set also set the projection of the featuresource to this WGS84toGoogle 
  
 something like 
 Dim myShapefile as new ShapeFileFeatureLayer 
 myShapefile.FeatureSource.Projection = WGS84toGoogle 
  
 if you added this layer to your map which is using a GoogleMapOverlay then it should display your Shapefile in the correct co-ords 
  
 However I will add I had issues with the Z-Order, ie I have the "CustomOverlay" (GoogleMapOverlay) drawing over the top of the StaticOverlay. 
  
 The way around that was to add the GoogleMapOverlay to the CustomOverlay then create a new LayerOverlay add my ShapefileLayer to the LayerOverlay then add that to the CustomOverlay. 
  
 As the LayerOverlay was added after the GoogleMapOverlay it will draw ontop. Not sure if you are using the GoogleMapOverlay but figured I woudl just add it while I was thinking about it :0

Thanks so much for your immediate help.

Thanks Michael! For helping others in the forum and help me with my work :)