VectorSource constructor

VectorSource({
  1. String? url,
  2. List<String>? tiles,
})

Implementation

factory VectorSource({
  String? url,
  List<String>? tiles,
}) {
  if (url != null && tiles != null) {
    throw Exception('Specify only one between url and tiles');
  }
  if (url != null) {
    return VectorSource.fromJsObject(VectorSourceJsImpl(
      type: 'vector',
      url: url,
    ));
  }
  return VectorSource.fromJsObject(VectorSourceJsImpl(
    type: 'vector',
    tiles: tiles,
  ));
}