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

react-native-bing-maps

v0.1.1

Published

React native wrapper for Bing Maps

Downloads

325

Readme

React Native Bing Maps

A React Native wrapper for Microsoft Bing Maps.

Example Screenshot

TOC

Installation

Using npm:

npm install --save react-native-bing-maps

Using yarn:

yarn add react-native-bing-maps

Linking

Automatic linking is supported for both iOS and Android

Previous versions need to do manual linking. No support is offered for these previous react-native versions. Upgrade to modern versions of react-native. Use upgrade-helper tool on the internet if needed.

Bing Maps Key

Bing Maps Key. Must be obtained to use the Bing Maps SDK. The Bing Maps Key will need to be set through the API to use the Bing Maps native control and to make API requests to Bing Maps services. Visit the Bing Maps Dev Center Help page for detailed steps on obtaining one.

Android credentials setup

In order to use Bing Maps on android you need to add the credential key to gradle.

  1. create a secrets.gradle file in android/app/ folder with the following contents
ext.credentialsKey = "you_bing_maps_key_here"
  1. apply this key in your android/app/build.gradle file by adding
apply from: 'secrets.gradle'

at the top.

  1. now add the key to the builds by adding
buildTypes.each {
        it.buildConfigField "String", "CREDENTIALS_KEY", "\"$credentialsKey\""
    }

in the android field next to defaultConfig. This will apply the same key to all build types.

OR

for separate creadential key for build types you can add it respective build type config

Usage

import * as React from 'react';

import { StyleSheet, View } from 'react-native';
import BingMapsView from 'react-native-bing-maps';

export default function App() {
  return (
    <View style={styles.container}>
      <BingMapsView
        credentialsKey="your_bing_maps_api_key"
        mapLocation={{ lat: 12.9010875, long: 77.6095084, zoom: 15 }}
        style={styles.box}
      />
    </View>
  );
}

Props

credentialsKey [iOS]: string (Required)

Bing Map key accquired from above steps.

mapLocation?: MapLocation

describes the currect location of the map. The MapLocation type is described here

pins?: MapPin[]

Array of pins to be displayed on the map. The MapPin type is described here.

mapStyle?: string

string in JSON format to change the appearance of the map. Refer How to change Appearance of map for detailed info. Or you can use map stylesheet generator to generate the JSON.

style?: ViewStyle

Style to be applied to the parent view of Bing Map view.

buildingsVisible?: boolean;

Sets the building visibility on the map.

businessLandmarksVisible?: boolean;

Sets the landmarks icons visibility on the map.

transitFeaturesVisible?: boolean;

Sets transit features visibility on the map.

compassButtonVisible?: boolean;

Sets compass button visiblity on the map.

tiltButtonVisible?: boolean;

Sets tilt button visibility on the map.

zoomButtonsVisible?: boolean;

Sets zoom buttons visibility on the map.

copyrightDisplay?: 'allowHiding' | 'always';

Sets the microsoft copyright caption visibility on the map.

onMapPinClicked?: (e: NativeSyntheticEvent) => void

Event returns lat and long of the pin clicked on map.

onMapLoadingStatusChanged?: (e: NativeSyntheticEvent) => void

Event returns the loading status of the map.

Types

BingMapsProps

type BingMapsProps = {
  credentialsKey: string;
  pins?: MapPin[];
  mapLocation?: MapLocation;
  mapStyle?: string;
  style?: ViewStyle;
  buildingsVisible?: boolean;
  businessLandmarksVisible?: boolean;
  transitFeaturesVisible?: boolean;
  compassButtonVisible?: boolean;
  tiltButtonVisible?: boolean;
  zoomButtonsVisible?: boolean;
  copyrightDisplay?: 'allowHiding' | 'always';
  onMapPinClicked?: (e: NativeSyntheticEvent<EventTarget>) => void;
  onMapLoadingStatusChanged?: (e: NativeSyntheticEvent<EventTarget>) => void;
};

MapLocation

MapLocation {
  lat: number;
  long: number;
  zoom: number;
}

Where zoom is a number between 1 and 19. For more info on zoom levels visit Microsoft's docs on Understanding Scale and Resolutions

MapPin

MapPin {
  lat: number;
  long: number;
  icon: string;
}

where icon is the SVG string for the pin icon you want to display;

License

MIT