Add to point some properties (name,key).How? take a look on code.

Maciej Skorczewski maciej.skorczewski at procad.pl
Tue Oct 17 04:24:50 EDT 2006


hi group!

In database are stored X,Y coordinates of points (hotels,pubs etc.)

My guestion is: How to add key value or ID to point properties.
I needs this to make onclick event whit popup information about cliked 
point. If i have id or key i can get data form database.

Hove can i add this properties? My new layer is selectable, i can click 
on it and select this point. key,name whit value.
should be visible in property task.



I add new point to map by this code

//--------Creating the point

$geometryFactory = new MgGeometryFactory();

//----- x,y are from database

$coordinate = $geometryFactory->CreateCoordinateXY($x,$y);
$point = $geometryFactory->CreatePoint($coordinate);
$rs->MoveNext();

//----------Define a property collection

$geometryReaderWriter = new MgAgfReaderWriter();
$properties = new MgPropertyCollection();
$properties->Add(new MgStringProperty('Owner','Puby'));

// is any code to add properties example. key,name whit value.
// i should be visible in property task.

$properties->Add(new MgGeometryProperty('SHPGEOM', 
$geometryReaderWriter->Write($point)));

//----------Create an insert command for this property.
$parcelMarkerCommands->Add(new MgInsertFeatures('Puby', $properties));




-- 
Maciej Skorczewski






More information about the Mapguide_users mailing list