在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):peledies/google-places开源软件地址(OpenSource Url):https://github.com/peledies/google-places开源编程语言(OpenSource Language):JavaScript 97.9%开源软件介绍(OpenSource Introduction):google-placesA jQuery plugin to render google places data. Currently the only only thing that is rendered is a list view of reviews. InstallInstall with bower. bower install google-places Install with npmnpm install google-places-data IncludeInclude 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
Optional Schema MarkupThe schema markup will render something like below: <span itemscope="" itemtype="http://schema.org/Hostel">
<meta itemprop="image" content="https://via.placeholder.com/150">
<meta itemprop="priceRange" content="$$">
<meta itemprop="url" content="https://example.org">
<meta itemprop="telephone" content="(303) 954-0962">
<div itemprop="address" itemscope="" itemtype="http://schema.org/PostalAddress" style="display: none;">
<span class="street-address" itemprop="streetAddress">1217 20th St</span>,
<span class="locality" itemprop="addressLocality">Denver</span>,
<span class="region" itemprop="addressRegion">CO</span>
<span class="postal-code" itemprop="postalCode">80202</span>,
<span class="country-name" itemprop="addressCountry">USA</span>
</div>
Google Users Have Rated
<span itemprop="name">Hostel Fish</span>
<span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4.80</span>/<span itemprop="bestRating">5</span>
based on <span itemprop="ratingCount">5</span>
ratings and reviews
</span>
</span>
staticMap options
Usage$("#google-reviews").googlePlaces({
placeId: 'ChIJa2uI-Nt4bIcR5cvnOxD4cFg'
, render: ['reviews']
, min_rating: 4
, max_rows:5
, map_plug_id: 'map-plug'
, rotateTime:5000
, shorten_names: true
, schema: {
displayElement: '#schema' // optional, will use "#schema" by default
, beforeText: 'Googlers rated'
, middleText: 'based on'
, afterText: 'awesome reviewers.'
, type: 'Hostel'
, image: 'https://via.placeholder.com/150'
, priceRange: '$$'
}
, 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
}
}); EventsThe plugin will trigger the following events, namespaced to '
function sayHi() {
alert('Hi!');
}
$("#google-reviews").on('afterRender.googlePlaces', sayHi); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论