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

nextjs-bingmaps

v0.0.1

Published

Bingmaps in React.js. React.js component for Bingmaps.

Downloads

24

Readme

React-Bingmaps

Introduction

React-Bingmaps is a react.js version of Bing Maps V8 Web Control

The main purpose of this version is to help you to write Bingmaps in React applications without any pain. Main principles of React-Bingmaps are:

  1. Simply deploy with React components
  2. Lightweight depending on Bing Maps V8 Web Control

Features

  • Bingmaps in React.js
  • Multiple Pushpin
  • Multiple Infobox
  • Multiple Pushpin with Infobox
  • Callback events in Pushpins and Infoboxes
  • Map types
  • Disable Street View
  • Zoom
  • Get Location on Mouse Events
  • Regular Polygon
  • Boundary
  • Polyline
  • Directions

Installation

npm

NPM is the easiest and fastest way to get started using React-Bingmaps.

# latest stable
$ npm i react-bingmaps

Import Module

To use react-bingmaps in your react app, you should import it first.

import { ReactBingmaps } from 'react-bingmaps';

Examples

Click here

Bingmaps

Follow Bing Maps Dev Center to get your Bingmaps key

<ReactBingmaps 
  bingmapKey = "[YourBingMapsKey]" > 
</ReactBingmaps>

Map center with loaction

<ReactBingmaps 
  bingmapKey = "[YourBingMapsKey]" 
  center = {[13.0827, 80.2707]}
  > 
</ReactBingmaps>

Alt text

Other props

mapTypeId : string
mapTypeId = {"road"}

Find more map types - MapTypeId Enumeration

navigationBarMode : string

navigationBarMode = {"compact"}

Find more NavigationBar Mode - NavigationBarMode Enumeration

supportedMapTypes : string[]

supportedMapTypes = {["road","canvasDark"]}

Find more Supported Map Types Mode - MapTypeId Enumeration

heading : oneOfType([ string, number ])

Note: Available only for map mode - BirdView

heading = {180}

zoom : number

zoom = {5}

disableStreetside : bool

disableStreetside={true}

pushPins : ArrayOf(objects)

pushPins = {
            [
              {
                "location":[13.0827, 80.2707], "option":{ color: 'red' }, "addHandler": {"type" : "click", callback: this.callBackMethod }
              },
              {
                ...
              }
            ]
          }

Find more option values - Pushpin
addHandler types - ["click", "mousedown", "mouseout", "mouseup", "mouseover"]

infoboxes : ArrayOf(objects)

infoboxes = {
            [
              {
                "location":[13.0827, 80.2707], "option":{ title: 'Chennai', description: '...' }, "addHandler": {"type" : "click", callback: this.callBackMethod}
              },
              {
                ...
              }
            ]
          }

Find more option values - Infobox
addHandler types - ["click", "mouseenter", "mouseleave"]

infoboxesWithPushPins : ArrayOf(objects)

infoboxesWithPushPins = {[
            {
              "location":[13.0827, 80.2707], 
              "addHandler":"mouseover", //on mouseover the pushpin, infobox shown
              "infoboxOption": { title: 'Infobox Title', description: 'Infobox' },
              "pushPinOption":{ title: 'Pushpin Title', description: 'Pushpin' },
              "infoboxAddHandler": {"type" : "click", callback: this.callBackMethod },
              "pushPinAddHandler": {"type" : "click", callback: this.callBackMethod }
            },
            {
              ...
            }
          ]
          }

getLocation : objects

getLocation = {
  {addHandler: "click", callback:this.AddPushPinOnClick}
}

Callback Method

AddPushPinOnClick(location){
  //Outputs latitude and longitude
  ...
}

regularPolygons : ArrayOf(objects)

regularPolygons = {
            [
              {
                "center":[13.0827, 80.2707],
                "radius":5,
                "points":3,
                "option": {fillColor: "green", strokeThickness: 2}
              },
              {
                ...
              }
            ]

Find more option values - PolygonOptions

boundary : object

//Static array of locations
boundary = {
              {
                "location":['chennai'],
                "option":{
                  entityType: 'PopulatedPlace'
                },
                "polygonStyle" :{
                  fillColor: 'rgba(161,224,255,0.4)',
                  strokeColor: '#a495b2',
                  strokeThickness: 2
                }
              }
            }

//Search by string
boundary = {
              {
                "search":"India",
                "option":{
                  entityType: 'PopulatedPlace'
                },
                "polygonStyle" :{
                  fillColor: 'rgba(161,224,255,0.4)',
                  strokeColor: '#a495b2',
                  strokeThickness: 2
                }
              }
            }

Find more option values - Get Boundary Options

Donation

If you think that any information you obtained here is worth of some money and are willing to pay for it, feel free to send any amount through paypal.

Contribution

We would love to hear what you think we should build. Please create an issue to write your usage or ideas.

We are looking for like-minded people who share the same idea about React-Bingmaps. The goal of this project is create a more flexible Bingmaps library for the React community.

License

MIT

Copyright (c) React-Bingmaps