GeoJSON Layer

The GeoJSON layer uses the GeoJSON data format to draw geometric objects over the map.

These geometric objects, such as a polygon, can be used to:

  • Highlight areas of the map.
  • Geofence the nodes defined in the network layer to an area of the map.
  • Filter the trajectories defined in the observations layer to an area of the map.

Data Format

An example of a GeoJSON object is as follows:

const vancouverDowntown = {
  type: "FeatureCollection",
  features: [
    {
      type: "Feature",
      id: "vancouver-downtown",
      geometry: {
        coordinates: [
          [
            [-123.112266, 49.290164],
            [-123.104240, 49.288166],
            [-123.099288, 49.289272],
            [-123.099998, 49.272750],
            [-123.101699, 49.272972],
            [-123.111076, 49.272926],
            [-123.114448, 49.271774],
            [-123.121162, 49.269538],
            [-123.129280, 49.269531],
            [-123.137680, 49.275318],
            [-123.132331, 49.276931],
            [-123.121093, 49.284366],
            [-123.136680, 49.294456],
            [-123.134689, 49.295810],
            [-123.122711, 49.291500],
            [-123.112266, 49.290164],
          ],
        ],
        type: "Polygon",
      },
    },
  ],
};

You can assign an ID to a GeoJSON feature, allowing event handlers to return the ID for an interaction.

A full definition of the GeoJSON data format can be found at https://geojson.org/.

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided “as is” and “as available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.