How to use the @swim/length.Length.px function in @swim/length

To help you get started, we’ve selected a few @swim/length examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swimos / traffic / ui / main / map / IntersectionMapViewController.ts View on Github external
protected initMarkerView(): void {
    let markerView = this.getChildView("marker") as MapCircleView | null;
    if (!markerView) {
      markerView = new MapCircleView();
      markerView.center.setState(new LngLat(this._info.lng, this._info.lat));
      markerView.radius.setState(Length.px(5));
      markerView.fill.setState(this._view!.intersectionMarkerColor.value!);
      markerView.on("click", this.onMarkerClick.bind(this));
      this.setChildView("marker", markerView);
    }
  }
github swimos / transit / ui / main / map / AgencyMapViewController.ts View on Github external
protected initMarkerView(): void {
    let markerView = this.getChildView("marker") as MapCircleView | null;
    if (!markerView && this._boundingBoxLink) {
      const boundingBox = this._boundingBoxLink.get().toAny() as unknown as AgencyBoundingBox | undefined;
      if (boundingBox) {
        const lng = (boundingBox.minLng + boundingBox.maxLng) / 2;
        const lat = (boundingBox.minLat + boundingBox.maxLat) / 2;
        markerView = new MapCircleView();
        markerView.center.setState(new LngLat(lng, lat));
        markerView.radius.setState(Length.px(10));
        markerView.fill.setState(this._view!.agencyMarkerColor.value!);
        markerView.on("click", this.onMarkerClick.bind(this));
        this.setChildView("marker", markerView);
      }
    }
  }

@swim/length

DOM-relative length types with unit-aware algebraic operators, conversions, and parsers

Apache-2.0
Latest version published 4 years ago

Package Health Score

61 / 100
Full package analysis