0.1.7 • Published 12 months ago

@1nf053c/mapbox-map v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@1nf053c/mapbox-map

a Reactjs component that renders a mapbox map

Getting Started

npm i @1nf053c/mapbox-map

https://www.npmjs.com/package/@1nf053c/mapbox-map

"use client";

import { MapboxMap } from "@1nf053c/mapbox-map";

export function MapboxMapContainer() {

    const config = {
        publicKey="YOUR_MAPBOX_PUBLIC_KEY",
        startLng=50,
        startLat=-51,
        zoomLevel=12
    }

    return <MapboxMap
        publicKey={config.publicKey}
        startLng={config.startLng}
        startLat={config.startLat}
        zoomLevel={config.zoomLevel} 
    />
}

// 1. import MapboxMap component
// 2. Create or fetch your MapboxMap config
// 3. Render MapboxMap component with config

What's Next:

Feature extensions with hooks
"use client";

import {
    MapboxMap,
    MapboxMapAthleticsAdvisorPlugin,
    MapboxMapRestaurantAdvisorPlugin,
    // ...etc
} from "@1nf053c/mapbox-map";

export function MapboxMapContainer() {

    const config = {
        publicKey="YOUR_MAPBOX_PUBLIC_KEY",
        startLng=50,
        startLat=-51,
        zoomLevel=12
    };

    const plugins = [MapboxMapAthleticsAdvisor, MapboxMapRestaurantAdvisor];
    
    return (
        <MapboxMap
            plugins={plugins}
            publicKey={config.publicKey}
            startLng={config.startLng}
            startLat={config.startLat}
            zoomLevel={config.zoomLevel} 
        />
    );
}
0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago