Skip to content

Commit

Permalink
Merge pull request #236 from dymaptic/feature/117-update-feataure-layer
Browse files Browse the repository at this point in the history
Code review feedback
  • Loading branch information
AndersenBell authored Oct 3, 2023
2 parents e1f2f85 + baf9743 commit cbc472f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</p>
<Label>Enter CSV Layer URL:</Label>
<InputText @bind-Value="_csvLayerUrl"></InputText>
<button disabled="@(!_mapRendered)" @onclick="AddLayer">Add new CSV Layer!</button>
<button disabled="@(!_viewRendered)" @onclick="AddLayer">Add new CSV Layer!</button>


<SceneView @ref="_view" class="map-view" OnViewRendered="OnMapRendered">
<SceneView @ref="_view" class="map-view" OnViewRendered="OnViewRendered">
<Extent Xmin="-41525513" Ymin="4969181" Xmax="-36687355" Ymax="9024624">
<SpatialReference Wkid="102100" />
</Extent>
Expand All @@ -31,9 +31,9 @@

@code {

private void OnMapRendered()
private void OnViewRendered()
{
_mapRendered = true;
_viewRendered = true;
}

private async Task AddLayer()
Expand All @@ -43,7 +43,7 @@
//we create a custom CSVLayer from a CSV url
var csvLayer = new CSVLayer(_csvLayerUrl);

if (_mapRendered)
if (_viewRendered)
{
await _view!.AddLayer(csvLayer);
}
Expand All @@ -54,5 +54,5 @@

private MapView? _view;

private bool _mapRendered;
private bool _viewRendered;
}
14 changes: 13 additions & 1 deletion src/dymaptic.GeoBlazor.Core/Components/Layers/FeatureLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using dymaptic.GeoBlazor.Core.Exceptions;
using dymaptic.GeoBlazor.Core.Objects;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Options;
using Microsoft.JSInterop;
using System.Text;
using System.Text.Json;
Expand Down Expand Up @@ -1340,8 +1339,21 @@ public record EditedFeatures(Graphic[] Adds, EditedFeatureUpdate[] Updates, Grap
/// </param>
public record EditedFeatureUpdate(Graphic[] Original, Graphic[] Current);

/// <summary>
/// FeatureType is a subset of features defined in a FeatureLayer that share the same attributes.
/// They are used as a way to categorize your data. For example, the streets in a city streets feature layer
/// could be categorized into three feature types: local streets, collector streets, and arterial streets.
/// </summary>
public record FeatureType(object Id, string DeclaredCLass, string Name, FeatureTemplate[] Templates, Dictionary<string, Domain?> Domains);

/// <summary>
/// Feature templates define all the information required to create a new feature in
/// a feature layer. These include information such as the default attribute values with
/// which a feature will be created, and the default tool used to create that feature.
/// </summary>
public record FeatureTemplate(string DeclaredClass, string Name, string Description, string DrawingTool, Thumbnail Thumbnail, dynamic Prototype);

/// <summary>
/// An object used to create a thumbnail image that represents a feature type in the feature template.
/// </summary>
public record Thumbnail(string ContentType, string ImageData, double Height, double Width);
38 changes: 0 additions & 38 deletions src/dymaptic.GeoBlazor.Core/Components/PortalFolder.cs

This file was deleted.

6 changes: 3 additions & 3 deletions src/dymaptic.GeoBlazor.Core/Components/Widgets/Domain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public class CodedValue<T> : MapComponent
}

/// <summary>
/// Inherited domains apply to domains at the feature type level. It implies that the domain for a given field at the feature
/// type level is the same as the domain for the field at the layer level.
/// NOTE: Name is not used and will always be null.
/// Inherited domains apply to domains at the feature type level. It implies that the domain for a given field at the feature
/// type level is the same as the domain for the field at the layer level.
/// NOTE: Name is not used and will always be null.
/// </summary>
public class InheritedDomain : Domain
{
Expand Down
2 changes: 1 addition & 1 deletion src/dymaptic.GeoBlazor.Core/Scripts/featureLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export default class FeatureLayerWrapper {
let result = await this.layer.getField(fieldName);

if (result != undefined) {
let field = buildDotNetFields(Array(result));
let field = buildDotNetFields([result]);

return field[0];
}
Expand Down

0 comments on commit cbc472f

Please sign in to comment.