ThinkGeo.com    |     Documentation    |     Premium Support

BlazorTrackMode.Modidy does not update a circle correctly

When selecting a drawn circle on the map and setting BlazorTrackMode.Modify clicking any point on the edge just moves that point. If I know the shape is a circle, then it should just adjust the radius from the center point. Polygon seems to work correctly. I have not tried the other shapes as these two or the ones I am most concerned with currently.

Thanks,
James R.

Hi James,

It is reproduced and fixed in the latest beta, 15.0.0-beta121.

A circle drawn with BlazorTrackMode.Circle carries its center and radius, which is why
that one resizes correctly. A circle your application builds does not: Feature stores
geometry as well-known binary, which has no circle type, so
new Feature(new EllipseShape(center, radius)) is already an ordinary polygon by the time
the overlay sees it — and Modify did the only thing it could with a polygon: drag the
vertex you grabbed.

We added EditOverlay.AddFeature to fix it:

// instead of: map.EditOverlay.Features.Add(new Feature(new EllipseShape(center, radius)));
map.EditOverlay.AddFeature(new EllipseShape(center, radius));

// optional id and column values:
map.EditOverlay.AddFeature(shape, "my-record-id", columnValues);

It accepts any shape — polygons, points and lines go through the same call and behave
exactly as before. Drag the edge of a circle added this way and it resizes around a fixed
center.

Two notes:

  • Saving. The circle is recorded in the feature’s ColumnValues under names starting
    with _tg_edit:
Column Value
__tg_edit_shape_type circle
__tg_edit_circle_center_x center X, in the map’s units
__tg_edit_circle_center_y center Y, in the map’s units
__tg_edit_circle_radius radius, in the map’s units
  • The overlay reads them back as well: a feature that still carries these values is edited
    as a circle again, one that doesn’t is edited as a polygon.
  • Reading it back. In OnFeatureModified, cast e.ModifiedGeometryInfo to
    CircleGeometryInfo for the center and radius — use GetGeodeticRadius(DistanceUnit.Meter)
    if you need a real ground distance rather than projection units.

One thing to confirm: what we fixed is the case where the circle comes from your own data.
If you are seeing this with a circle you just drew and did not reload, let us know and that
would be a different issue.

Thanks,
Ben

Thanks Ben. I will look at this soon and get back to. We had a demo last week and I have two other more pressing issues to address. I will post both of these today.