Skip to main content

GeoJSONLayer

Introduction

The GeoJSONLayer is used to display GeoJSON data on a map. It can be declared alone or with child components to customize its behavior:

import React from "react";
import { GeoJSONLayer, MapView } from "esrieact";

const GEOJSON_URL = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojson";

export const ReactMap: React.FC = () => {
return (
<MapView>
<GeoJSONLayer url={GEOJSON_URL} />
</MapView>
);
};

Props

Props extends GeoJSONLayer properties

children

Children components can be any of the following esrieact components:

  • LayerView component
  • Any Renderer component that is compatible with a GeoJSONLayer
  • Graphic or multiple Graphics components

events

GeoJSONLayerEventHandlerFnMap: An event handler function map based on the events available on a GeoJSONLayer

  "refresh": __esri.GeoJSONLayerRefreshEventHandler;
"edits": __esri.GeoJSONLayerEditsEventHandler;
"layerview-create": __esri.GeoJSONLayerLayerviewCreateEventHandler;
"layerview-create-error": __esri.GeoJSONLayerLayerviewCreateErrorEventHandler;
"layerview-destroy": __esri.GeoJSONLayerLayerviewDestroyEventHandler;