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

@s-ui/sui-map-google

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@s-ui/sui-map-google

Simple bindings to the Google Maps API using React. Most of the components provided by this library are wrappers of [react-google-maps-api](https://github.com/JustFly1984/react-google-maps-api)

  • 1.4.0
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-40.87%
Maintainers
1
Weekly downloads
 
Created
Source

MapGoogle

Simple bindings to the Google Maps API using React. Most of the components provided by this library are wrappers of react-google-maps-api

Installation

$ npm install @s-ui/sui-map-google

Usage

Map

Render a map. Toggle between a static map image and a dynamic map using isInteractive prop. The dynamic map is a wrapper of GoogleMap but also loads Google Maps script out of the box. Use loaderNode and errorNode to optionally display loading and error states. All the props defined in the wrapped component are also available.

import MapGoogle from '@s-ui/sui-map-google'

const MapGoogleExample = () => {
  return <MapGoogle apiKey="AIzaSyDp7wqS1IyRZCvMMsY2LX2V1TXY4Lh8UGA" />
}
Add-ons

Render a set of add-ons on the dynamic map setting the following components as children of MapGoogle.

import MapGoogle from '@s-ui/sui-map-google'
import MapGoogleMarker from '@s-ui/sui-map-google/lib/marker/index.js'

const MapGoogleAddOnsExample = () => {
  return (
    <MapGoogle apiKey="AIzaSyDp7wqS1IyRZCvMMsY2LX2V1TXY4Lh8UGA">
      <MapGoogleMarker position={{lat: 40.714728, lng: -73.998672}} />
    </MapGoogle>
  )
}
MapImage

Render a static map image. Similar to MapGoogle it requires the apiKey prop. The rest of the props are the parameters defined in the Maps Static API documentation (e.g. center and zoom).

import MapGoogleImage from '@s-ui/sui-map-google/lib/image/index.js'

const MapGoogleImageExample = () => {
  return (
    <MapGoogleImage
      apiKey="AIzaSyDp7wqS1IyRZCvMMsY2LX2V1TXY4Lh8UGA"
      center="40.714728,-73.998672"
      zoom="12"
      size="600x600"
      alt="Mapa"
      width="600"
      height="600"
    />
  )
}
Import the styles (Sass)
@import '~@s-ui/theme/lib/index';
/* @import 'your theme'; */
@import '~@s-ui/sui-map-google/lib/index';

Find full description and more examples in the demo page.

FAQs

Package last updated on 25 Aug 2022

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