ThinkGeo.com    |     Documentation    |     Premium Support

Map Feature update stopped working with V10.2.0.0, but the same is working in DetectGPS sample with v10.0.0.0

Following code snippet from DetectGPS.cs was working fine with 10.0.0.0 version, when I added routing module to the project it upgraded the dll to 10.2.0.0 and the feature update on the MAP logic stopped working.

if I replace the dlls with old version V10.0.0.0 - same code works

no exceptions thrown - but NO UI is updating.

Do I need to handle this differently?

Feature feature1 = vehicleLayer.InternalFeatures[“GPSFeature1”];
PointShape pointShape = feature1.GetShape() as PointShape;

        double lon = GPSlocations[index].X;
        double lat = GPSlocations[index].Y;

        pointShape.X = lon;
        pointShape.Y = lat;
        pointShape.Id = "GPSFeature1";

vehicleLayer.Open();
vehicleLayer.EditTools.BeginTransaction();
vehicleLayer.EditTools.Update(pointShape);
vehicleLayer.EditTools.CommitTransaction();
vehicleLayer.Close();

        winformsMap1.Refresh(vehicleOverlay);

Hi Naren,

Please just comment this line: pointShape.Id = “GPSFeature1”;

That’s because we fixed an issue in 10.2.

Regards,

Ethan

Hi Ethan,

After I commented looks like the ID is becoming GUID, so I had to change the

Feature feature1 = vehicleLayer.InternalFeatures[“GPSFeature1”];

to

Feature feature1 = vehicleLayer.InternalFeatures[0];

is there any other method available to get by feature name?

Thanks for your support.
Naren

Hi Naren,

Are you using InmemoryFeatureLayer or some other layer?

If you are using InmemoryFeatureLayer, you don’t need to change the vehicleLayer.InternalFeatures[“GPSFeature1”], the “GPSFeature1” here is not the pointShape.Id = “GPSFeature1”;. It’s the vehicleLayer.InternalFeatures.add(“GPSFeature1”, yourFeature).

Regards,

Ethan