Skip to content

Angular

ngx-worldwind provides standalone components with signal inputs, OnPush change detection and no dependency on zone.js. Import them individually or all at once with WORLDWIND_COMPONENTS.

ts
@Component({
  selector: 'app-map',
  imports: [...WORLDWIND_COMPONENTS],
  template: `
    <ww-globe [options]="options" [projection]="projection()" style="height: 100vh" (globeClick)="onClick($event)">
      <span wwFallback>Loading…</span>
      <ww-layer kind="osm" [enabled]="false" />
      <ww-renderable-layer name="Cities">
        <ww-placemark [position]="{ latitude: 40.7128, longitude: -74.006 }" label="New York" (shapeClick)="select($event)" />
      </ww-renderable-layer>
      <ww-layer-switcher />
      <ww-navigation-controls />
    </ww-globe>
  `,
})
export class MapComponent {
  options: GlobeOptions = { layers: ['blue-marble-landsat', 'atmosphere'] };
  projection = signal<ProjectionKind>('3d');
}

Add @import 'ngx-worldwind/styles.css'; to your global styles.

Components

SelectorPurpose
ww-globeCreates the globe. options (creation), projection (reactive), hoverPicking; outputs ready, loadError, globeClick, globeDoubleClick, globeHover; signals globe, cameraState, layers, projectionState, hoverPick
ww-layerBuilt-in layer by kind
ww-wms-layerOGC WMS by hand, or with [fromCapabilities]="true"
ww-wmts-layerOGC WMTS from GetCapabilities (styleName, matrixSet, format)
ww-geojson-layerGeoJSON styled per feature through featureStyle
ww-kml-layerKML or KMZ
ww-cluster-layerMany points as count markers that split on zoom (items, radius, (clusterClick), (itemClick))
ww-renderable-layer, ww-custom-layerShape container, escape hatch
ww-placemark, ww-path, ww-polygon, ww-surface-polyline, ww-surface-polygon, ww-surface-circle, ww-geographic-textShapes with shapeClick, shapeDoubleClick, mouseEnter, mouseLeave outputs and highlightOnHover
ww-cameraDeclarative camera
ww-panel, ww-layer-switcher, ww-navigation-controls, ww-goto-box, ww-coordinates, ww-measure-tool, ww-projection-switcher, ww-scale-bar, ww-compass, ww-attribution, ww-legend, ww-time-slider, ww-draw-toolWidgets
ww-popupContent anchored to a geographic position (position, anchor, offset, heading, closable, (closed)), following the globe

Layer components accept asynchronous factories and emit loadError. Hover outputs on shapes need [hoverEvents]="true", because picking on every frame costs GPU time.

Injecting state

Inside <ww-globe>, injectGlobe(), injectCameraState(), injectLayers(), injectProjection() and injectHoverPick() return signals you can use in your own components.

Two naming notes

  • styleName and featureStyle are not called style: a static style attribute is consumed by the DOM before it can reach a component input.
  • Shapes go inside ww-renderable-layer; the layer is injected, so nesting is required.

See the API reference.

MIT licensed. Not affiliated with NASA; WorldWind is NASA's open-source virtual globe.