npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bradtech/map

v1.2.0

Published

Map for Brad web apps

Downloads

22

Readme

Map Component

React Map Component created for Brad Technology web apps.

Supports both Google Map and MapBox.

Getting started

npm i @bradtech/map

OR

yarn add @bradtech/map

Map props

| Name | Type | Default | Description | | ---------- | --------------------------------------- | --------------------------- | ------------------------------------------------ | | width | string | '600px' | Map width | | height | string | '600px' | Map height | | display | 'block' | 'inline' | '' | CSS display property | | center | {latitude: number; longitude: number} | {latitude: 0; longitude: 0} | Default location | | zoom | number | 12 | Default zoom level | | markerList | {latitude: number; longitude: number}[] | [] | List containing the markers the map will display | | kmlList | string[] | [] | List containing KML codes to display KML layers | | apiKey | string | null | Google Map or MapBox API key | | decorator | GoogleMapDecorator | MapBoxDecorator | GoogleMapDecorator | Component that will be used to display the map |

Examples

Display a basic map

import React from 'react'
import { Map } from '@bradtech/map'

export default class App extends React.Component {
   constructor(props) {
      super(props)
   }

   render() {
      return (
         <Map
            width="100%"
            zoom={6}
            center={{ latitude: 43.932658, longitude: 4.821883 }}
            apiKey={'GOOGLE_MAP_API_KEY'}
         />
      )
   }
}

Display a map using MapBox

import React from 'react'
import { Map, MapBoxDecorator } from '@bradtech/map'

export default class App extends React.Component {
   constructor(props) {
      super(props)
   }

   render() {
      return (
         <Map
            width="100%"
            zoom={6}
            center={{ latitude: 43.932658, longitude: 4.821883 }}
            decorator={MapBoxDecorator}
            apiKey={'MAPBOX_API_KEY'}
         />
      )
   }
}

Display markers

import React from 'react'
import { Ma } from '@bradtech/map'

export default class App extends React.Component {
   constructor(props) {
      super(props)

      this.markerList = [
         { longitude: -110.65264890901744, latitude: 44.59255346806212 },
      ]
   }

   render() {
      return (
         <Map
            width="100%"
            zoom={6}
            markerList={this.markerList}
            apiKey={'GOOGLE_MAP_API_KEY'}
         />
      )
   }
}

License

MIT