docsby gkjohnson
Drawing GeoJSON borders over the globe
Data courtesy of geojson-maps, Esri World Imagery
On this page

Methods

new GeoJSONOverlay(
	options?: {
		// GeoJSON FeatureCollection or Feature object to render. If not provided, `url` must be set so the data can be fetched on init.
		geojson: Object = null,

		// URL to a GeoJSON file to fetch on initialization (used when `geojson` is not supplied directly).
		url: string = null,

		// Canvas resolution (pixels) used when compositing tiles.
		resolution: number = 256,

		// Per-feature style callback. When provided, overrides `strokeStyle`, `fillStyle`, `strokeWidth`, and `pointRadius`.
		getStyle?: ( feature: Object, properties: Object ) => VectorTileStyle | null,

		// Radius in pixels used to render Point features.
		pointRadius: number = 6,

		// Canvas stroke style for feature outlines.
		strokeStyle: string = 'white',

		// Stroke line width in pixels.
		strokeWidth: number = 2,

		// Canvas fill style for feature interiors.
		fillStyle: string = 'rgba( 255, 255, 255, 0.5 )',

		// Overlay opacity (0–1).
		opacity: number = 1,

		// Tint color.
		color: number | Color = 0xffffff,

		// Planar projection frame. If null, cartographic projection is used.
		frame: Matrix4 = null,

		// URL rewriting callback.
		preprocessURL: function = null,

		// Use alpha channel as a surface mask.
		alphaMask: boolean = false,

		// Invert the alpha channel.
		alphaInvert: boolean = false
	}
)

Inherited