layout: default title: GeoJSONLayer parent: Core Classes —
dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components.Layers
GeoJSONLayer Class
The GeoJSONLayer class is used to create a layer based on GeoJSON. GeoJSON is a format for encoding a variety of
geographic data structures. The GeoJSON data must comply with the RFC 7946 specification which states that the
coordinates are in SpatialReference.WGS84.
ArcGIS Maps SDK for JavaScript
public class GeoJSONLayer : dymaptic.GeoBlazor.Core.Components.Layers.Layer,
dymaptic.GeoBlazor.Core.Interfaces.IFeatureReductionLayer,
dymaptic.GeoBlazor.Core.Components.Layers.IPopupTemplateLayer
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Layer 🡒 GeoJSONLayer
Implements IFeatureReductionLayer, IPopupTemplateLayer
Example
Constructors
GeoJSONLayer() Constructor
Parameterless constructor for using as a razor component
public GeoJSONLayer();
GeoJSONLayer(string, string, string, Nullable, Nullable, Nullable) Constructor
Constructs a new GeoJSONLayer in code with parameters
public GeoJSONLayer(string? url=null, string? copyright=null, string? title=null, System.Nullable<double> opacity=null, System.Nullable<bool> visible=null, System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.ListMode> listMode=null);
Parameters
url
System.String
The url for the GeoJSON source data.
copyright
System.String
A copyright string to identify ownership of the data.
title
System.String
The title of the layer used to identify it in places such as the Legend and LayerList widgets.
opacity
System.Nullable<System.Double>
The opacity of the layer.
visible
System.Nullable<System.Boolean>
Indicates if the layer is visible in the View. When false, the layer may still be added to a Map instance that is
referenced in a view, but its features will not be visible in the view.
listMode
System.Nullable<ListMode>
Indicates how the layer should display in the LayerList widget. The possible values are listed below.
Properties
GeoJSONLayer.Copyright Property
A copyright string to identify ownership of the data.
public string? Copyright { get; set; }
Property Value
GeoJSONLayer.LayerType Property
Used internally to identify the sub type of Layer
public override string LayerType { get; }
Property Value
GeoJSONLayer.PopupTemplate Property
The popup template for the layer. When set on the layer, the popupTemplate allows users to access attributes and display their values in the view’s popup when a feature is selected using text and/or charts. See the PopupTemplate sample for an example of how PopupTemplate interacts with a FeatureLayer.
A default popup template is automatically used if no popupTemplate has been defined when Popup.defaultPopupTemplateEnabled is set to true.
public dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate? PopupTemplate { get; set; }
Implements PopupTemplate
Property Value
GeoJSONLayer.Renderer Property
The Renderer that defines how the GeoJSON data will be displayed.
public dymaptic.GeoBlazor.Core.Components.Renderers.Renderer? Renderer { get; set; }
Property Value
GeoJSONLayer.SpatialReference Property
The SpatialReference to render the GeoJSON data.
public dymaptic.GeoBlazor.Core.Components.Geometries.SpatialReference? SpatialReference { get; set; }
Property Value
GeoJSONLayer.Url Property
The url for the GeoJSON source data.
public string? Url { get; set; }
Property Value
Methods
GeoJSONLayer.RegisterChildComponent(MapComponent) Method
Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with it’s parent.
public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The calling, child component to register
Returns
Exceptions
InvalidChildElementException
Throws if the current child is not a valid sub-component to the parent.
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method. If you see no other way to register a child component, please open an issue on GitHub.
GeoJSONLayer.UnregisterChildComponent(MapComponent) Method
Undoes the “Registration” of a child with its parent.
public override System.Threading.Tasks.Task UnregisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The child to unregister
Returns
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method.