Get started
Examples

Open street view from the map

Open street view from the map

StreetViewControl runs the drag, the corridor gate, and the coverage check, then hands you the surviving point. Opening a panorama is your application's job.

import { MapControls, MapView, StreetViewControl } from "@mountaya/elements-react";

export const StreetView = () => (
  <div style={{ height: 340, position: "relative" }}>
    <MapView center={[6.87, 45.85]} client={client} terrain="topo" zoom={14} />
    <MapControls compass zoom>
      <StreetViewControl
        googleMapsApiKey={googleMapsApiKey}
        minZoom={12}
        onOpen={openPanorama}
      />
    </MapControls>
  </div>
);

minZoom keeps the handle inert on a wide view, because coverage is asked one point at a time.

Next steps