Could it be that "ID" is the primary key, and if you insert two features with ID 11, it breaks? Or that the ID is auto-assigned, and thus not assignable from MapGuide/FDO?

btw, things tend to work better with MapGuide if your primary key is an integer.

Regards, Kenneth Skovhede, GEOGRAF A/S



Stefan Dalakov skrev:
It is something stupid, but I cannot spot it...
Everything works if I omit the bold part of the code :

  function MakeLine($name, $x0, $y0 , $x1, $y1)
  {
    $propertyCollection = new MgPropertyCollection();
*    $cntr = (double) 11.0 ;
    $idProperty = new MgDoubleProperty("ID",$cntr);
    $propertyCollection->Add($idProperty);
*    $owner = "Aaa" ;
    $ownerProperty = new MgStringProperty("Owner", $owner);
    $propertyCollection->Add($ownerProperty);
    $nameProperty = new MgStringProperty("Purpose", $name);
    $propertyCollection->Add($nameProperty);
    $wktReaderWriter = new MgWktReaderWriter();
    $agfReaderWriter = new MgAgfReaderWriter();
    $agftext = "LINESTRING XY ($x0 $y0, $x1 $y1)" ;
    $geometry = $wktReaderWriter->Read( $agftext);
    $geometryByteReader = $agfReaderWriter->Write($geometry);
$geometryProperty = new MgGeometryProperty("Geometry", $geometryByteReader);
    $propertyCollection->Add($geometryProperty);
    return $propertyCollection;
  }

MG Studio says this property is Double

Stefan Dalakov


Kenneth Skovhede, GEOGRAF A/S wrote:
You could be affected by this bug:
http://trac.osgeo.org/mapguide/ticket/649

Otherwise, try to post a section of the code,
maybe someone will spot something obvious.

Regards, Kenneth Skovhede, GEOGRAF A/S



Stefan Dalakov skrev:
Hi all,
I am trying to add a feature (permanently) to a data source.
I am using MGOS 1.2 and tried Sheboygan samples, where this part is not working, I have not explored the reason yet. My idea is to digitize a feature ( a line ) and add it permanently to an existing layer on the map. I wrote some code, and everything seems OK, no errors, but at the end I have no feature added.
Can someone help with a piece of code ?

Thanks in advance
Stefan Dalakov
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users


------------------------------------------------------------------------

_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to