Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-simple-google-maps

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-google-maps

Simple components for rendering Google Maps via the Google Maps JavaScript API

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-simple-google-maps

Simple components for rendering Google Maps via the Google Maps JavaScript API

Installation

npm install react react-addons-shallow-compare react-simple-google-maps

Usage

Ensure the Google Maps JS API script is already loaded. react-simple-google-maps will use a global named google.maps.

To create a new map, just render a <Map> component. Markers and Polylines are children of the Map, and an InfoWindow can be a child of a Marker. An InfoWindow's children will be rendered into the InfoWindow when it is displayed.

Coordinates are passed using the native Google Maps coordinates or bounds objects.

bounds = new google.maps.LatLngBounds();
position = new google.map.LatLng(65, -100);
bounds.extend(position);
position = new google.map.LatLng(40, -125);
bounds.extend(position);

markerPosition = new google.map.LatLng(50, -115);

<Map
  bounds={bounds}
  panControlOptions={position: google.maps.ControlPosition.LEFT_BOTTOM}
  ref="map"
  scrollwheel={true}
  streetViewControl={false}
  style={height: 500}
  zoomControlOptions={position: google.maps.ControlPosition.LEFT_BOTTOM} >
  <Marker
    position={markerPosition}
    title='Start'
    zIndex=1
    <InfoWindow>
      <h1>I am a marker!</h1>
    </InfoWindow>
  </Marker>
</Map>

Keywords

FAQs

Package last updated on 20 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc