GeoJsonSource | MapGL | 2GIS Documentation
MapGL JS API

GeoJsonSource

  • Class for creating geoJson data source on the map
new constructor(map, options)

Example:

const source = new GeoJsonSource(map, {
   data: {
       type: 'FeatureCollection',
       features: [
           {
               type: 'Feature',
               properties: {},
               geometry: {
                   type: 'Point',
                   coordinates: [82.92186, 55.03029],
               },
            },
       ],
   },
});
Parameters
map
Map

The map instance

options
GeoJsonSourceOptions

Spatial data source options

Returns
Methods