# google-places-data

> A jquery plugin for rendering google places data.

Latest version **0.1.1** (published 2017-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install google-places-data
pnpm add google-places-data
yarn add google-places-data
bun add google-places-data
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-04-05 |
| First published | 2017-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 78 |
| Author | Deac |
| Maintainers | rakibabu |
| Keywords | google, places, reviews |

## Links

- npm: https://www.npmjs.com/package/google-places-data
- Repository: https://github.com/peledies/google-places
- Homepage: https://github.com/peledies/google-places#readme
- Issues: https://github.com/peledies/google-places/issues
- npm.io page: https://npm.io/package/google-places-data

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2017-04-05

## README

# google-places
A jQuery plugin to render google places data.

Currently the only only thing that is rendered is a list view of reviews. 

[Demos](http://peledies.github.io/google-places/)

### Install
Install with bower.
```
bower install google-places
```

### Include
Include these files in the head
```
<link rel="stylesheet" href="bower_components/google-places/google-places.css">
<script src="bower_components/google-places/google-places.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
```

### Options

| Required | Description |
|----------|-------------|
| **placeId**  | google placeId |

| Optional | Type | Description | Default |
|----------|----------|-------------|----------|
| **render** | Array | supports reviews, schema, phone, address, hours, staticMap | ['reviews','phone','hours','address,'staticMap']
| **min_rating** | Int | Only display reviews with a minimum rating (not applicable for schema)| 0
| **max_rows** | Int | Maximum number of rows to show - 0 for all (not applicable for schema)| 0
| **rotateTime** | Int | Time in MS to show review before rotating or false for no rotate | false
| **schema** | Object | Options for displaying Schema | see below |

### Optional Schema Markup
The schema markup will render something like below: 
```
<span itemscope="" itemtype="http://schema.org/Store">
    <meta itemprop="url" content="http://example.com">
    Google Users Have Rated 
    <span itemprop="name">
        Hostel Fish
    </span> 
    <span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
        <span itemprop="ratingValue">5</span>/<span itemprop="bestRating">5</span> 
        based on <span itemprop="ratingCount">5</span> ratings and reviews
    </span>
</span>
```

| Schema | Type | Description | Default |
|----------|----------|-------------|----------|
| **displayElement** | Object | Jquery object or string location where the schema will be appended | '#schema' |
| **beforeText** | String | Text before ratings | 'Google Users Have Rated' |
| **middleText** | String | Text in between ratings | 'based on' |
| **afterText** | String | last text in rating | 'ratings and reviews' |
| **type** | String | schema.org [type](https://schema.org/docs/full.html) | 'Store' |

### staticMap options
| property | Description | Default |
|----------|-------------|----------|
| **width** | map width | 512 |
| **height** | map height | 512 |
| **zoom** | zoom index for map | 17 |
| **type** | map type (roadmap, terrain, satellite, hybrid) | roadmap |


### Usage

```
$("#google-reviews").googlePlaces({
    placeId: 'ChIJa2uI-Nt4bIcR5cvnOxD4cFg'
  , render: ['reviews']
  , min_rating: 4
  , max_rows:5
  , rotateTime:5000
  , schema: {
            displayElement: '#schema' // optional, will use "#schema" by default
          , beforeText: 'Googlers rated'
          , middleText: 'based on'
          , afterText: 'awesome reviewers.'
          , type: 'Hostel'
      }
  , address:{
    displayElement: "#custom-address-id" // optional, will use "#google-address" by default
  }
  , phone:{
    displayElement: "#custom-phone-id" // optional, will use "#google-phone" by default
  }
  , staticMap:{
      displayElement: "#google-static-map" // optional, will use "#google-static-map" by default
  }
  , hours:{
      displayElement: "#google-hours" // optional, will use "#google-hours" by default
  }
});
```

---
_Source: https://npm.io/package/google-places-data · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
