[mapguide-users] Parcel Marker in 2.02

George McLean gmclean at gorge.net
Thu Nov 6 12:35:16 EST 2008


I am running MGOS 2.02 on Windows XP, migrating code from MGOS 1.2. The 
code below is based on the parcel Marker demo code and works fine in 
1.2. In 2.02 parcel markers from the previous search do not get cleared. 
I have traced the code and the MgDeleteFeatures call appears to be added 
to the $parcelmarkerCommands object but the old markers do not clear 
like they do in MGOS 1.2.

Any suggestions? I have not looked at the Parcel Marker sample code for 
2.02, would that show me how to do this in 2.02?

Thanks

George McLean




        $parcelMarkerLayer = GetLayerByName($map, 'ParcelMarker');
        if ($parcelMarkerLayer == null)
        {
            CreateParcelMarkerFeatureSource($featureService, 
$parcelMarkerFeatureSourceId, $WKT, 'ParcelMarker');
            $parcelMarkerLayer = 
CreateParcelMarkerLayer($resourceService, $parcelMarkerFeatureSourceId, 
$mgSessionId,  'ParcelMarker');
            $map->GetLayers()->Insert(0, $parcelMarkerLayer);
        }
        else
        {
            $parcelMarkerCommands->Add(new 
MgDeleteFeatures('ParcelMarker', "ID like '%'"));
        }



// Select some new features to mark............

// Now update the display to mark the newly selected features.

        $parcelMarkerLayer = GetLayerByName($map, 'ParcelMarker');
        if ($parcelMarkerLayer == null)
        {
            CreateParcelMarkerFeatureSource($featureService, 
$parcelMarkerFeatureSourceId, $WKT, 'ParcelMarker');
            $parcelMarkerLayer = 
CreateParcelMarkerLayer($resourceService, $parcelMarkerFeatureSourceId, 
$mgSessionId,  'ParcelMarker');
            $map->GetLayers()->Insert(0, $parcelMarkerLayer);
        }
        else
        {
            $parcelMarkerCommands->Add(new 
MgDeleteFeatures('ParcelMarker', "ID like '%'"));
        }




More information about the mapguide-users mailing list