leaflet#Polygon TypeScript Examples

The following examples show how to use leaflet#Polygon. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: iot-map-area.ts    From IOT-Map-Component with MIT License 6 votes vote down vote up
/**
 * Class IotMapArea displaying a Area
 */
export class IotMapArea extends Polygon {
  private data: IotArea
  private config: IotMapConfig
  private map: IotMapManager

  /**
   * Creates an area
   * @param area - an IotArea containing information to display a area
   * @param map - the map the area will be displayed on
   * @param config - the config to use to display the area
   */
  constructor (area: IotArea, map: IotMapManager, config: IotMapConfig) {
    super(area.points,
      {
        color: area.color ?? config.area.color,
        fillColor: area.fillColor ?? config.area.fillColor,
        fillOpacity: area.fillOpacity ?? config.area.fillOpacity,
        weight: 3,
        smoothFactor: 1,
        interactive: false
      })

    this.data = area
    this.config = config
    this.map = map
  }
}
Example #2
Source File: LiveAtlasPolygon.ts    From LiveAtlas with Apache License 2.0 5 votes vote down vote up
export default class LiveAtlasPolygon extends Polygon {
	declare options: LiveAtlasPolygonOptions;

	constructor(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options: LiveAtlasPathMarker) {
		super(latlngs, options.style);
	}
}