[mapguide-users] Re: Kml +Google earth
navya024
navya.gudupi at gmail.com
Thu Jul 8 01:16:14 EDT 2010
Hi sir,
sorry for distrubance.but i tried on this integration.iam strucking in some
where
i created the pages
master.php
calles.php
test.kml
from test.kml iam calling master.php and calles.php
while opening test.kml i got the following error that
fetching n/w link
"towers"failed(http://localhost/mapguide/googleearthapp/calles.php)
http:server error
that i understood that the error was in calles.php
here is my calles.php code
<?php
include 'AppConstants.php';
include 'UtilityFunctions.php';
$outString = '';
MgInitializeWebTier ($configFilePath);
$siteConnection = new MgSiteConnection();
$siteConnection->Open(new MgUserInformation("Administrator", "admin"));
$geometryFactory = new MgGeometryFactory();
$featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);
$resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);
$map = new MgMap();
$map->Open($resourceService,'Mapdata');
$layer = $map->GetLayers()->GetItem(4);
$layerClassName = $layer->GetFeatureClassName();
$outString .= '<?xml version="1.0" encoding="UTF-8"?>';
$outString .= '<kml xmlns="http://earth.google.com/kml/2.0">';
$outString .= '<Document>';
$outString .= '
<Style id="myBoundaryLine">
<LineStyle>
<color>ffff00ff</color>
<colorMode>normal</colorMode>
<width>3</width>
</LineStyle>
<PolyStyle>
<color>00ffffff</color>
<colorMode>normal</colorMode>
</PolyStyle>
</Style>
';
$featureReader = $featureService->SelectFeatures(new
MgResourceIdentifier("Library://demodata/Data/Towerdata.FeatureSource"),
$layerClassName, null);
$geometryReaderWriter = new MgAgfReaderWriter();
while ($featureReader->ReadNext())
{
$byteReader = $featureReader->GetGeometry('Geometry');
$geometry = $geometryReaderWriter->Read($byteReader);
$outString .= '<Placemark>';
$outString .= '<name>'.
$featureReader->GetString($featureReader->GetPropertyName(1)) .'</name>';
$outString .= '<styleUrl>#myBoundaryLine</styleUrl>';
$outString .= CreateKMLGeometry($geometry, 0);
$outString .= '</Placemark>';
}
$featureReader->Close();
$outString .= '</Document>';
$outString .= '</kml>';
echo ($outString);
SendKmlContent($outString,'kml');
?>
i was unable to know what is my wrong in that????
plz guide me once.
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Kml-Google-earth-tp5268525p5268552.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list