react-hotels-on-map
Advanced tools
Comparing version 0.3.1 to 1.0.0
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
/* global global */ | ||
@@ -8,0 +9,0 @@ |
@@ -31,8 +31,8 @@ 'use strict'; | ||
exports.default = function (_ref) { | ||
var ratingStars = _ref.ratingStars; | ||
var name = _ref.name; | ||
var streetAddress = _ref.streetAddress; | ||
var postalCode = _ref.postalCode; | ||
var cityLocalized = _ref.cityLocalized; | ||
var ratingStars = _ref.ratingStars, | ||
name = _ref.name, | ||
streetAddress = _ref.streetAddress, | ||
postalCode = _ref.postalCode, | ||
cityLocalized = _ref.cityLocalized; | ||
return nonEmptyItems([starText(ratingStars), name, addressLine(streetAddress, postalCode, cityLocalized)]).join(selfClosedTag('br')); | ||
}; |
@@ -42,3 +42,6 @@ 'use strict'; | ||
propTypes: { hotels: _react2.default.PropTypes.array.isRequired }, | ||
propTypes: { | ||
hotels: _react2.default.PropTypes.array.isRequired, | ||
markerClusterImageUrlPrefix: _react2.default.PropTypes.string | ||
}, | ||
@@ -58,3 +61,3 @@ render: function render() { | ||
element.removeChild(element.querySelector('.gm-style')); | ||
element.removeChild(element.querySelector('div')); | ||
this.map = null; | ||
@@ -71,2 +74,3 @@ this.initMap(); | ||
var markers = this.markers(); | ||
var options = { gridSize: 30 }; | ||
@@ -76,4 +80,8 @@ if (markers.length === 1) { | ||
} else { | ||
var clusterer = new _MarkerClusterer2.default(this.map, markers, { gridSize: 30 }); | ||
if (this.props.markerClusterImageUrlPrefix) { | ||
options.imagePath = this.props.markerClusterImageUrlPrefix; | ||
} | ||
var clusterer = new _MarkerClusterer2.default(this.map, markers, options); | ||
clusterer.fitMapToMarkers(this.map, markers); | ||
@@ -97,6 +105,7 @@ } | ||
var maps = global.window.google.maps; | ||
var _props$hotels$0$geolo = this.props.hotels[0].geolocation; | ||
var latitude = _props$hotels$0$geolo.latitude; | ||
var longitude = _props$hotels$0$geolo.longitude; | ||
var _props$hotels$0$geolo = this.props.hotels[0].geolocation, | ||
latitude = _props$hotels$0$geolo.latitude, | ||
longitude = _props$hotels$0$geolo.longitude; | ||
this.map.setCenter({ lat: latitude, lng: longitude }); | ||
@@ -103,0 +112,0 @@ this.map.setZoom(13); |
@@ -6,7 +6,8 @@ "use strict"; | ||
}); | ||
/* global global */ | ||
exports.default = function (_ref) { | ||
var latitude = _ref.latitude; | ||
var longitude = _ref.longitude; | ||
var latitude = _ref.latitude, | ||
longitude = _ref.longitude; | ||
return new global.window.google.maps.Marker({ | ||
@@ -13,0 +14,0 @@ position: { lat: latitude, lng: longitude } |
'use strict'; | ||
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
@@ -189,3 +189,3 @@ // ==ClosureCompiler== | ||
*/ | ||
MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ = 'https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' + 'images/m'; | ||
MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ = 'https://www.swisshotels.com/client-side-public/img/markerclustererplus/m'; | ||
@@ -209,3 +209,3 @@ /** | ||
MarkerClusterer.prototype.extend = function (obj1, obj2) { | ||
return (function (object) { | ||
return function (object) { | ||
for (var property in object.prototype) { | ||
@@ -215,3 +215,3 @@ this.prototype[property] = object.prototype[property]; | ||
return this; | ||
}).apply(obj1, [obj2]); | ||
}.apply(obj1, [obj2]); | ||
}; | ||
@@ -218,0 +218,0 @@ |
{ | ||
"name": "react-hotels-on-map", | ||
"version": "0.3.1", | ||
"version": "1.0.0", | ||
"description": "Presents a set of hotels as clustered markers on Google Map, each with an info window displaying the hotel summary", | ||
@@ -15,3 +15,3 @@ "main": "build/index.js", | ||
"tdd": "mocha -w -R min --compilers js:babel-core/register -r tests/helpers/jsdom-bootstrap -t 4000 ./tests/*.spec.js", | ||
"demo": "browserify src/demo.js -t babelify | uglifyjs > www/demo/bundle.js", | ||
"demo": "browserify src/demo.js -t babelify | uglifyjs -m > www/demo/bundle.js", | ||
"demo-watch": "watchify src/demo.js -t babelify -d -o www/demo/bundle.js -v" | ||
@@ -18,0 +18,0 @@ }, |
@@ -45,2 +45,12 @@ [![Build Status](https://travis-ci.org/ikr/react-hotels-on-map.svg?branch=master)](https://travis-ci.org/ikr/react-hotels-on-map) | ||
You're encouraged to also set the `markerClusterImageUrlPrefix` prop value, and host the cluster | ||
images on your own Web property. The default value is | ||
`https://www.swisshotels.com/client-side-public/img/markerclustererplus/m`, giving you those: | ||
![](https://www.swisshotels.com/client-side-public/img/markerclustererplus/m1.png) | ||
![](https://www.swisshotels.com/client-side-public/img/markerclustererplus/m2.png) | ||
![](https://www.swisshotels.com/client-side-public/img/markerclustererplus/m3.png) | ||
![](https://www.swisshotels.com/client-side-public/img/markerclustererplus/m4.png) | ||
![](https://www.swisshotels.com/client-side-public/img/markerclustererplus/m5.png) | ||
## One hotel case | ||
@@ -47,0 +57,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
48591
1202
0
65