Anmoldeep Singh

MapControls

Buttons 55

About

Interactive map controls for zoom, compass, geolocation, and fullscreen actions.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds MapControls to your project and fits it to your theme.

Code

How MapControls is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { Map, MapControls } from "@/components/ui/mapcn-map-controls";

const settings = {
  center: [2.3522, 48.8566],
  zoom: 10,
};

export default function MapControlsDemo(props: Partial<typeof settings>) {
  const s = { ...settings, ...props };
  return (
    <div className="h-screen w-screen flex items-center justify-center overflow-hidden bg-background p-8">
      <div className="h-[420px] w-full max-w-4xl overflow-hidden rounded-lg border bg-background shadow-sm">
        <Map center={s.center} zoom={s.zoom}>
          <MapControls
            position="top-right"
            showZoom
            showCompass
            showLocate
            showFullscreen
          />
        </Map>
      </div>
    </div>
  );
}

export { MapControlsDemo };

Dependencies

More by Anmoldeep Singh

View all
  • MarkerPopup

    MarkerPopup

    414
  • MapArc

    MapArc

    284
  • Map

    Map

    257
  • MarkerTooltip

    MarkerTooltip

    230
  • LayerMarkers

    LayerMarkers

    134
  • MarkerLabel

    MarkerLabel

    122
  • MarkerContent

    MarkerContent

    99
  • MapMarker

    MapMarker

    80

More in Buttons

View all
  • Texture Button

    Texture Button

    108
  • Button

    Button

    14
  • Notification Button

    Notification Button

    117
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Eclipse Button

    Eclipse Button

    44
  • Button Save

    Button Save

    50
  • App Store Button

    App Store Button

    484
  • Base Button

    Base Button

    1