[mapguide-users] Use GoogleEarth for my map

alba a.penitente at gepaspa.com
Fri Sep 26 07:51:32 EDT 2008


Hi all

I have installed on my server the example DynamicKml and on browser
http://myserver/mapguide/DynamicKml/GoogleEarth.php
all ok

I have replaced the map (WheatonParcelQueryMap) of example with my map, but
GoogleEarth not zoom on my coordinates

$wktProj =
"GEOGCS[\"LL84\",DATUM[\"WGS84\",SPHEROID[\"WGS8\",6378137.000,298.25722293]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.01745329251994]]";

in the file UtilityFunctions.php I have replaced the row
echo $coord->GetX() . ',' . $coord->GetY() . ',' .$ht . ' ';
with the row
echo Convert2WGS84($coord->GetX() . ',' . $coord->GetY()) . ',' .$ht . ' ';
and insert this function

function Convert2WGS84($retval)
{
//lat lon
   $wktProj =
"GEOGCS[\"LL84\",DATUM[\"WGS84\",SPHEROID[\"WGS84\",6378137.000,298.25722293]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.01745329251994]]";

  //$wktProj =
'PROJCS["ED50-UTM29",GEOGCS["LLERP50-W",DATUM["ERP50-W",SPHEROID["INTNL",6378388.000,297.00000000]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["false_easting",500000.000],PARAMETER["false_northing",0.000],PARAMETER["central_meridian",-9.00000000000000],PARAMETER["scale_factor",0.9996],PARAMETER["latitude_of_origin",0.000],UNIT["Meter",1.00000000000000]]';

$coordFINAL='';
$coordSysFactory = new MgCoordinateSystemFactory();
$coordSysProj = $coordSysFactory->Create($wktProj);
$coordTemp = split(",",$retval);
$lat = $coordTemp[0];
$lon = $coordTemp[1];
$geometryFactory = new MgGeometryFactory();
$coordinate = $geometryFactory->CreateCoordinateXY($lat, $lon);
$convertedCoordinate = $coordSysProj->ConvertToLonLat($coordinate);
$coordFINAL .= ($convertedCoordinate->GetX() - 0.001368756879) . ',' .
($convertedCoordinate->GetY() - 0.000489774927);
return $coordFINAL;
}

but It don't go, why?

I ask help

Bye Alba





-- 
View this message in context: http://www.nabble.com/Use-GoogleEarth-for-my-map-tp19686961p19686961.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list