GeoJsonSource | MapGL | 2GIS Documentation
MapGL JS API
Личный кабинет

GeoJsonSource

Class for creating GeoJSON data source in 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