Salta el contingut

GeoJSON Service (Web URL)

Create a GeoJSON service using a URL link without the need to load the data in the editor. Below, we will explain the steps to follow from the geoportal administrator to create a GeoJSON layer from a URL. The tool is located in the Capes Manager → GeoJSON Capes section.

GeoJSON layers will always be in vector format.

Screenshot

Configuration

Check the general options at Information, layer properties.

GeoJSON Options

Screenshot

  • URL: In this field is where the URL link goes.
  • Headers: Used for token authentication, the necessary header is sent to force authentication between server and browser or vice versa.
  • Data file: This option allows selecting a data file if we do not have a URL.
  • Cache Time: The geoportal caches the data and only updates it at the specified interval. If we are loading a layer that is updated very often, we should set this value low, for example, the location of a fleet of vehicles. If we want to force the update, we need to activate the Force data refresh option and save the layer again.
  • Maximum Outdated Time: Maximum accepted outdated time for the layer.
  • Download/Generation Dates: Read-only. The download date and generation date of the layer.

GeoJSON Filters

The geoportal allows adding filters to a GeoJSON layer. Multiple filters can be added to show/hide specific data from the same layer. For example, a layer of parking lots in a city can be divided between public and private, free and paid parking…

To add a filter, click on the Add another Geo JSON filter link in the GeoJSON Capes tab.

Screenshot

The filter conditions are written as follows: field name + conditional in JavaScript format. Multiple conditions can be written in a single filter.

For example, in a layer with all parking lots, we filter parking lots that are public and paid:
owner == 'public' && type == 'payment'

Design Options

In this tab, you can manage which fields and in what order they are displayed in the data table, as well as the design of the marker or the layer’s symbology that appears on the geoportal map. This mainly refers to options for interacting with the symbology, such as tooltips, additional information in popups, etc.

To manage the fields, click on the cross on the label to hide them, and to show them again, click on the fields box, which will display a list of available fields. To reorder them, simply drag the label to the desired position.

Screenshot

  • Get Design From: The first option allows us to obtain a design already created previously. If it exists, it can be chosen to use it; if not, the process to create one is detailed below.

  • Enable Interaction: Whether the user can interact (click) on the elements represented on the map or not.

  • Tooltip: HTML code to show the tooltip. If we do not want to show a tooltip, leave this option blank. Below is an example of a tooltip that appears when the cursor hovers over a marker without clicking.

Screenshot

  • Generate Popup with More Data Information: Creates an automatic popup with the fields of the first record of the GeoJSON.
  • Popup: HTML code to show the popup. If we do not want to show a popup, leave this option blank.

Screenshot

  • Legend: HTML code to show the legend in the layer information panel. If we do not want to show a legend, leave this option blank.
  • Enable Clustering: Allows grouping point data based on proximity. If this option is activated, the settings need to be configured.
{
    "spiderfyOnMaxZoom": true,
    "showCoverageOnHover": false,
    "zoomToBoundsOnClick": false,
    "maxClusterRadius": 2
}

Check all the available options from:: Cluster options