[mapguide-users] Unable to select polygon?!?

Ivan Milicevic Ivan.Milicevic at supranet.hr
Tue Mar 31 04:05:55 EDT 2009


Hello,

 

I have strange problem :)

 

-2 polygon features in SDF file (left and right) -I can not select left feature -I can select right feature

 

In Map 3D 2010 everything looks ok. In FDO Tools, SDF looks just fine. The difference between those features is that left one is created from web code and right one is created from Map 3D.

 

Any idea?

 

The link below is link to sdf file:

http://www.supranet.hr/downloads/sdf.zip

 

and down there is code that I used to create polygon:

 

.......main function......

{

//adding coord to MgCoordinateCollection

coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y + 50));

coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y + 50));

coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y - 50));

coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y - 50));

 

//creating polygon

MgPolygon polyObjekt = createPolygon();

byteReader = agfReaderWriter.Write(polyObjekt);

 

//defining properties in MgPropertyCollection

fillProperties(id, napomena, naziv, oznaka, 1, byteReader);

 

//inserting in SDF

insertOnMap();

}

 

public MgPolygon createPolygon()

{

MgLinearRing mgRing = geometryFactory.CreateLinearRing(coords);

MgLinearRingCollection mgRingCollection = new MgLinearRingCollection();

mgRingCollection.Add(mgRing);

 

MgPolygon mgPoly = geometryFactory.CreatePolygon(mgRing, null);

return mgPoly;

}

 

public void fillProperties(Int32 ID, string napomena, string naziv, string oznaka, Int32 vrstaObjekta, MgByteReader bReader)

{

properties.Clear();

properties.Add(new MgInt32Property("ID", ID));

properties.Add(new MgStringProperty("NAPOMENA", napomena));

properties.Add(new MgStringProperty("NAZIV", naziv));

properties.Add(new MgStringProperty("OZNAKA", oznaka));

properties.Add(new MgInt32Property("VRSTAOBJEKTA", vrstaObjekta));

properties.Add(new MgGeometryProperty("Geom", bReader));

}

 

public void insertOnMap()

{

MgSiteConnection siteConnection = null;

MgUserInformation userInfo = new MgUserInformation(mgSessionId);

siteConnection = new MgSiteConnection();

siteConnection.Open(userInfo);

MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;

MgFeatureService featureService = siteConnection.CreateService(MgServiceType.FeatureService) as MgFeatureService;

MgResourceIdentifier resId = new MgResourceIdentifier("Library://PROJEKTI/ZLZ/PODACI/OBJEKTI.FeatureSource");

MgFeatureCommandCollection commands = new MgFeatureCommandCollection();

string layerClassName = "OBJEKTI";

MgInsertFeatures mgInsert = new MgInsertFeatures(layerClassName, properties);

commands.Add(mgInsert);

featureService.UpdateFeatures(resId, commands, false);

}"

 

 

Ivan Miličević

voditelj odjela razvoja

 

SUPRA NET d.o.o.
Majstorska 5, 10000 Zagreb
CROATIA

Mobile: +385 (0)91 434-3940
Office: +385 (0)1 434-3940
Fax: +385 (0)1 434-3999
Email: ivan.milicevic at supranet.hr <mailto:ivan.milicevic at supranet.hr> 

URL: www.supranet.hr <http://www.supranet.hr/> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090331/f5ea7dfe/attachment.html


More information about the mapguide-users mailing list