0.1.2 • Published 11 months ago

map-gl-compass-pro v0.1.2

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

map-gl-compass-pro npm npm downloads

New generation maps require new generation tools!

Screen

Example implementation

Usage

As for now map-gl-compass-pro works only with react & react-map-gl (react-map-gl is peer dependency). If community will express will of using it with raw mapbox / maplibre library I will add some wrapper around this component.

import MapGL from 'react-map-gl'
import maplibregl from 'maplibre-gl'
import CompassPro from 'map-gl-compass-pro'

function Map(){

  (...)

  return (
      <MapGL
        initialViewState={{
          longitude: 14.5580,
          latitude: 53.4441,
          zoom: 14
        }}
        mapLib={maplibregl}
        mapStyle="https://my-domain.com/mapStyle.json"
      >
        <CompassPro 
          mapId="myMap" // optional, default: current
          size="lg" // optional, one of  'xs' | 'sm' | 'md' | 'lg', default: 'md'
          visualizePitch={true} // optional, default false
          onNeedleClick={handleNeedleClick} // optional, default set pitch & bearing to 0 
          wrapperClass="ownClassName" // optional, default absolutely positioned in bottom left corner
        />
      (...)    
      </MapGL>
    );
}

Please make sure that Compass is child of MapGL, otherwise it won't work. Also read more about react-map-gl setup and mapId.

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.1

12 months ago