@react-google-maps/api
Advanced tools
Comparing version 1.2.0-alpha.14 to 1.2.0
# Changelog | ||
## 1.2.0-alpha5 Typescript refactoring | ||
## 1.2.0 Typescript refactoring | ||
** Full embrace of strongly typed functionality. Autocomplete in your typescript projects out of the box. | ||
** Added onLoad and onUnmount callback props for each component. | ||
** added addon MarkerClusterer | ||
* BREAKING: LoadScript wrapping div was changed to a sibling div https://github.com/JustFly1984/react-google-maps-api/commit/3f52446b756ce7dc47b5886f1a07071f6a2643ec | ||
* Full embrace of strongly typed functionality. Autocomplete in your typescript projects out of the box. | ||
* Added onLoad and onUnmount callback props for each component. | ||
* added addon MarkerClusterer | ||
## 1.1.1-alpha Additional component support | ||
** StreetViewPanorama | ||
** StreetViewService | ||
** MarkerClusterer | ||
* StreetViewPanorama | ||
* StreetViewService | ||
* MarkerClusterer | ||
## 1.1.0 | ||
** Re-write in Typescript | ||
** DEPRECATED: FuctionTablesLayer (was deprecated by google and support will be cut completely on December 3, 2019) | ||
* Re-write in Typescript | ||
* DEPRECATED: FuctionTablesLayer (was deprecated by google and support will be cut completely on December 3, 2019) | ||
@@ -20,0 +21,0 @@ ## 1.0.10 Fix cleanup in `<LoadScript />` |
@@ -92,2 +92,9 @@ "use strict"; | ||
var markerClusterer_1 = new marker_clusterer_1.Clusterer(this.context, [], this.props.options); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: markerClusterer_1 | ||
}); | ||
this.setState(function setClusterer() { | ||
@@ -94,0 +101,0 @@ return { |
@@ -59,2 +59,9 @@ "use strict"; | ||
var directionsRenderer = new google.maps.DirectionsRenderer(this.props.options); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: directionsRenderer | ||
}); | ||
this.setState(function setDirectionsRenderer() { | ||
@@ -61,0 +68,0 @@ return { |
@@ -24,3 +24,2 @@ /// <reference types="googlemaps" /> | ||
static contextType: React.Context<google.maps.Map | null>; | ||
registeredEvents: google.maps.MapsEventListener[]; | ||
state: OverlayViewState; | ||
@@ -27,0 +26,0 @@ containerElement: HTMLElement | null; |
@@ -36,3 +36,2 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.registeredEvents = []; | ||
_this.state = { | ||
@@ -39,0 +38,0 @@ overlayView: null |
@@ -6,3 +6,3 @@ /// <reference types="googlemaps" /> | ||
} | ||
interface CircleProps { | ||
export interface CircleProps { | ||
options?: google.maps.CircleOptions; | ||
@@ -9,0 +9,0 @@ center: google.maps.LatLng | google.maps.LatLngLiteral; |
@@ -85,2 +85,9 @@ "use strict"; | ||
var circle = new google.maps.Circle(__assign({}, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: circle | ||
}); | ||
function setCircle() { | ||
@@ -87,0 +94,0 @@ return { |
@@ -105,2 +105,9 @@ "use strict"; | ||
var data = new google.maps.Data(__assign({}, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: data | ||
}); | ||
function setData() { | ||
@@ -107,0 +114,0 @@ return { |
@@ -65,2 +65,9 @@ "use strict"; | ||
var drawingManager = new google.maps.drawing.DrawingManager(__assign({}, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: drawingManager | ||
}); | ||
function setDrawingManager() { | ||
@@ -67,0 +74,0 @@ return { |
@@ -86,2 +86,9 @@ "use strict"; | ||
this.containerElement = document.createElement("div"); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: infoWindow | ||
}); | ||
function setInfoWindow() { | ||
@@ -88,0 +95,0 @@ return { |
@@ -121,2 +121,9 @@ "use strict"; | ||
} | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: marker | ||
}); | ||
function setMarker() { | ||
@@ -123,0 +130,0 @@ return { |
@@ -84,2 +84,9 @@ "use strict"; | ||
var polygon = new google.maps.Polygon(__assign({}, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: polygon | ||
}); | ||
function setPolygon() { | ||
@@ -86,0 +93,0 @@ return { |
@@ -80,2 +80,9 @@ "use strict"; | ||
var polyline = new google.maps.Polyline(__assign({}, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: polyline | ||
}); | ||
function setPolyline() { | ||
@@ -82,0 +89,0 @@ return { |
@@ -81,2 +81,9 @@ "use strict"; | ||
var rectangle = new google.maps.Rectangle(__assign({}, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: rectangle | ||
}); | ||
function setRectangle() { | ||
@@ -83,0 +90,0 @@ return { |
@@ -62,2 +62,9 @@ "use strict"; | ||
var heatmapLayer = new google.maps.visualization.HeatmapLayer(__assign({ data: this.props.data }, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: heatmapLayer | ||
}); | ||
function setHeatmapLayer() { | ||
@@ -64,0 +71,0 @@ return { |
@@ -15,2 +15,13 @@ "use strict"; | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -30,2 +41,3 @@ var react_1 = require("react"); | ||
url: function (instance, url) { | ||
console.log({ instance: instance, url: url }); | ||
instance.setUrl(url); | ||
@@ -46,7 +58,4 @@ }, | ||
_this.setKmlLayerCallback = function () { | ||
if (_this.state.kmlLayer !== null) { | ||
_this.state.kmlLayer.setMap(_this.context); | ||
if (_this.props.onLoad) { | ||
_this.props.onLoad(_this.state.kmlLayer); | ||
} | ||
if (_this.state.kmlLayer !== null && _this.props.onLoad) { | ||
_this.props.onLoad(_this.state.kmlLayer); | ||
} | ||
@@ -57,3 +66,10 @@ }; | ||
KmlLayer.prototype.componentDidMount = function () { | ||
var kmlLayer = new google.maps.KmlLayer(this.props.options); | ||
var kmlLayer = new google.maps.KmlLayer(__assign({}, this.props.options, { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: kmlLayer | ||
}); | ||
function setLmlLayer() { | ||
@@ -60,0 +76,0 @@ return { |
@@ -55,2 +55,9 @@ "use strict"; | ||
var trafficLayer = new google.maps.TrafficLayer(__assign({}, (this.props.options || {}), { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: trafficLayer | ||
}); | ||
function setTrafficlayer() { | ||
@@ -57,0 +64,0 @@ return { |
@@ -60,2 +60,9 @@ "use strict"; | ||
var groundOverlay = new google.maps.GroundOverlay(this.props.url, this.props.bounds, __assign({}, this.props.options, { map: this.context })); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: groundOverlay | ||
}); | ||
function setGroundOverlay() { | ||
@@ -62,0 +69,0 @@ return { |
@@ -61,2 +61,9 @@ "use strict"; | ||
var autocomplete_1 = new google.maps.places.Autocomplete(input, this.props.options); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: autocomplete_1 | ||
}); | ||
this.setState(function setAutocomplete() { | ||
@@ -63,0 +70,0 @@ return { |
@@ -51,2 +51,9 @@ "use strict"; | ||
var searchBox_1 = new google.maps.places.SearchBox(input, this.props.options); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: searchBox_1 | ||
}); | ||
this.setState(function setSearchBox() { | ||
@@ -53,0 +60,0 @@ return { |
@@ -75,2 +75,9 @@ "use strict"; | ||
var streetViewPanorama = this.context.getStreetView(); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: streetViewPanorama | ||
}); | ||
function setStreetViewPanorama() { | ||
@@ -77,0 +84,0 @@ return { |
export declare function setKey(key: string): void; | ||
export declare function getKey(): string; | ||
export declare function getKey(): string | null; | ||
//# sourceMappingURL=docs-api-key.d.ts.map |
@@ -1,3 +0,3 @@ | ||
declare const _default: "AIzaSyC2C8wxa2nINcPvOOFwPWkyBjiHK_2NekM"; | ||
declare const _default: null; | ||
export default _default; | ||
//# sourceMappingURL=googleMapKey.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "AIzaSyC2C8wxa2nINcPvOOFwPWkyBjiHK_2NekM"; | ||
exports.default = null; |
@@ -6,3 +6,3 @@ import * as React from "react"; | ||
interface ScriptLoadedProps { | ||
children: React.ReactChild | React.ReactChildren; | ||
children: React.ReactChild | React.ReactChildren | Function; | ||
} | ||
@@ -15,5 +15,5 @@ declare class ScriptLoaded extends React.Component<ScriptLoadedProps, ScriptLoadedState> { | ||
componentWillUnmount(): void; | ||
render(): string | number | React.ReactChildren | JSX.Element; | ||
render(): any; | ||
} | ||
export default ScriptLoaded; | ||
//# sourceMappingURL=ScriptLoaded.d.ts.map |
@@ -51,5 +51,6 @@ "use strict"; | ||
ScriptLoaded.prototype.render = function () { | ||
return this.state.scriptLoaded | ||
? (this.props.children) | ||
: (React.createElement(SpanIntro, null)); | ||
if (!this.state.scriptLoaded) { | ||
return React.createElement(SpanIntro, null); | ||
} | ||
return (this.props.children instanceof Function) ? this.props.children() : this.props.children; | ||
}; | ||
@@ -56,0 +57,0 @@ return ScriptLoaded; |
@@ -110,9 +110,2 @@ "use strict"; | ||
if (_this.state.map !== null) { | ||
_this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: _this.props, | ||
instance: _this.state.map | ||
}); | ||
if (_this.props.onLoad) { | ||
@@ -130,2 +123,9 @@ _this.props.onLoad(_this.state.map); | ||
var map = this.getInstance(); | ||
this.registeredEvents = helper_1.applyUpdatersToPropsAndRegisterEvents({ | ||
updaterMap: updaterMap, | ||
eventMap: eventMap, | ||
prevProps: {}, | ||
nextProps: this.props, | ||
instance: map | ||
}); | ||
function setMap() { | ||
@@ -132,0 +132,0 @@ return { |
{ | ||
"name": "@react-google-maps/api", | ||
"version": "1.2.0-alpha.14", | ||
"version": "1.2.0", | ||
"description": "React.js Google Maps API integration", | ||
@@ -75,6 +75,7 @@ "license": "MIT", | ||
"docs:build": "npx styleguidist build", | ||
"tc": "tsc -p ./tsconfig.json --noEmit --traceResolution" | ||
"tc": "tsc -p ./tsconfig.json --noEmit --traceResolution", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"@react-google-maps/marker-clusterer": "1.2.0-alpha.9", | ||
"@react-google-maps/marker-clusterer": "1.2.0", | ||
"@types/googlemaps": "3.30.19", | ||
@@ -93,2 +94,3 @@ "@types/invariant": "2.2.29", | ||
"@types/babel-types": "7.0.6", | ||
"@types/jest": "^24.0.11", | ||
"@typescript-eslint/eslint-plugin": "1.5.0", | ||
@@ -120,2 +122,3 @@ "@typescript-eslint/parser": "1.5.0", | ||
"husky": "1.3.1", | ||
"jest": "^24.7.1", | ||
"react": "16.8.6", | ||
@@ -125,3 +128,5 @@ "react-docgen-typescript": "1.12.3", | ||
"react-styleguidist": "8.0.6", | ||
"react-testing-library": "^6.1.2", | ||
"rimraf": "2.6.3", | ||
"ts-jest": "^24.0.2", | ||
"typescript": "3.4.1", | ||
@@ -131,2 +136,2 @@ "webpack": "4.29.6" | ||
"gitHead": "4c487da5fec5e5d9e86f8d445248353b1f532a59" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
345012
184
7847
1
39
+ Added@react-google-maps/marker-clusterer@1.2.0(transitive)
- Removed@react-google-maps/marker-clusterer@1.2.0-alpha.9(transitive)