File tree Expand file tree Collapse file tree 14 files changed +84
-95
lines changed Expand file tree Collapse file tree 14 files changed +84
-95
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ import {default as componentLifecycleDecorator} from "../../utils/componentLifec
14
14
import { default as GoogleMapHolder } from "../../creators/GoogleMapHolder" ;
15
15
16
16
export const infoBoxControlledPropTypes = {
17
+ // NOTICE!!!!!!
18
+ //
19
+ // Only expose those with getters & setters in the table as controlled props.
20
+ //
17
21
// http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html
18
22
content : PropTypes . any ,
19
23
options : PropTypes . object ,
@@ -57,13 +61,7 @@ export default class InfoBoxCreator extends Component {
57
61
// a isomorphic server.
58
62
const GoogleMapsInfobox = require ( "google-maps-infobox" ) ;
59
63
// http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html
60
- const infoBox = new GoogleMapsInfobox ( composeOptions ( infoBoxProps , [
61
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference
62
- "content" ,
63
- "position" ,
64
- "visible" ,
65
- "zIndex" ,
66
- ] ) ) ;
64
+ const infoBox = new GoogleMapsInfobox ( composeOptions ( infoBoxProps , infoBoxControlledPropTypes ) ) ;
67
65
68
66
if ( infoBoxProps . children ) {
69
67
setContentForOptionalReactElement ( infoBoxProps . children , infoBox ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
13
13
import { default as GoogleMapHolder } from "./GoogleMapHolder" ;
14
14
15
15
export const circleControlledPropTypes = {
16
+ // NOTICE!!!!!!
17
+ //
18
+ // Only expose those with getters & setters in the table as controlled props.
19
+ //
16
20
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
21
+ //
17
22
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Circle
18
23
center : PropTypes . any ,
19
24
draggable : PropTypes . bool ,
@@ -53,14 +58,7 @@ export default class CircleCreator extends Component {
53
58
static _createCircle ( circleProps ) {
54
59
const { mapHolderRef} = circleProps ;
55
60
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Circle
56
- const circle = new google . maps . Circle ( composeOptions ( circleProps , [
57
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#CircleOptions
58
- "center" ,
59
- "draggable" ,
60
- "editable" ,
61
- "radius" ,
62
- "visible" ,
63
- ] ) ) ;
61
+ const circle = new google . maps . Circle ( composeOptions ( circleProps , circleControlledPropTypes ) ) ;
64
62
65
63
circle . setMap ( mapHolderRef . getMap ( ) ) ;
66
64
Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
14
14
import { default as GoogleMapHolder } from "./GoogleMapHolder" ;
15
15
16
16
export const directionsRendererControlledPropTypes = {
17
+ // NOTICE!!!!!!
18
+ //
19
+ // Only expose those with getters & setters in the table as controlled props.
20
+ //
17
21
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
22
+ //
18
23
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#DirectionsRenderer
19
24
directions : PropTypes . any ,
20
25
options : PropTypes . object ,
@@ -50,12 +55,7 @@ export default class DirectionsRendererCreator extends Component {
50
55
static _createDirectionsRenderer ( directionsRendererProps ) {
51
56
const { mapHolderRef} = directionsRendererProps ;
52
57
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#DirectionsRenderer
53
- const directionsRenderer = new google . maps . DirectionsRenderer ( composeOptions ( directionsRendererProps , [
54
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#DirectionsRendererOptions
55
- "directions" ,
56
- "panel" ,
57
- "routeIndex" ,
58
- ] ) ) ;
58
+ const directionsRenderer = new google . maps . DirectionsRenderer ( composeOptions ( directionsRendererProps , directionsRendererControlledPropTypes ) ) ;
59
59
60
60
directionsRenderer . setMap ( mapHolderRef . getMap ( ) ) ;
61
61
Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
13
13
import { default as GoogleMapHolder } from "./GoogleMapHolder" ;
14
14
15
15
export const drawingManagerControlledPropTypes = {
16
+ // NOTICE!!!!!!
17
+ //
18
+ // Only expose those with getters & setters in the table as controlled props.
19
+ //
16
20
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
21
+ //
17
22
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#DrawingManager
18
23
drawingMode : PropTypes . any ,
19
24
options : PropTypes . object ,
@@ -45,10 +50,7 @@ export default class DrawingManagerCreator extends Component {
45
50
static _createDrawingManager ( drawingManagerProps ) {
46
51
const { mapHolderRef} = drawingManagerProps ;
47
52
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#DrawingManager
48
- const drawingManager = new google . maps . drawing . DrawingManager ( composeOptions ( drawingManagerProps , [
49
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#DrawingManagerOptions
50
- "drawingMode" ,
51
- ] ) ) ;
53
+ const drawingManager = new google . maps . drawing . DrawingManager ( composeOptions ( drawingManagerProps , drawingManagerControlledPropTypes ) ) ;
52
54
53
55
drawingManager . setMap ( mapHolderRef . getMap ( ) ) ;
54
56
Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ import {default as composeOptions} from "../utils/composeOptions";
12
12
import { default as componentLifecycleDecorator } from "../utils/componentLifecycleDecorator" ;
13
13
14
14
export const mapControlledPropTypes = {
15
+ // NOTICE!!!!!!
16
+ //
17
+ // Only expose those with getters & setters in the table as controlled props.
18
+ //
15
19
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
20
+ //
16
21
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map
17
22
center : PropTypes . object ,
18
23
heading : PropTypes . number ,
@@ -52,15 +57,7 @@ export default class GoogleMapHolder extends Component {
52
57
53
58
static _createMap ( domEl , mapProps ) {
54
59
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map
55
- return new google . maps . Map ( domEl , composeOptions ( mapProps , [
56
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapOptions
57
- "center" ,
58
- "heading" ,
59
- "mapTypeId" ,
60
- "streetView" ,
61
- "tilt" ,
62
- "zoom" ,
63
- ] ) ) ;
60
+ return new google . maps . Map ( domEl , composeOptions ( mapProps , mapControlledPropTypes ) ) ;
64
61
}
65
62
66
63
getMap ( ) {
Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
14
14
import { default as GoogleMapHolder } from "./GoogleMapHolder" ;
15
15
16
16
export const infoWindowControlledPropTypes = {
17
+ // NOTICE!!!!!!
18
+ //
19
+ // Only expose those with getters & setters in the table as controlled props.
20
+ //
17
21
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
22
+ //
18
23
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#InfoWindow
19
24
content : PropTypes . any ,
20
25
options : PropTypes . object ,
@@ -52,12 +57,7 @@ export default class InfoWindowCreator extends Component {
52
57
static _createInfoWindow ( infoWindowProps ) {
53
58
const { mapHolderRef, anchorHolderRef} = infoWindowProps ;
54
59
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#InfoWindow
55
- const infoWindow = new google . maps . InfoWindow ( composeOptions ( infoWindowProps , [
56
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#InfoWindowOptions
57
- "content" ,
58
- "position" ,
59
- "zIndex" ,
60
- ] ) ) ;
60
+ const infoWindow = new google . maps . InfoWindow ( composeOptions ( infoWindowProps , infoWindowControlledPropTypes ) ) ;
61
61
62
62
if ( infoWindowProps . children ) {
63
63
setContentForOptionalReactElement ( infoWindowProps . children , infoWindow ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
14
14
import { default as GoogleMapHolder } from "./GoogleMapHolder" ;
15
15
16
16
export const markerControlledPropTypes = {
17
+ // NOTICE!!!!!!
18
+ //
19
+ // Only expose those with getters & setters in the table as controlled props.
20
+ //
17
21
// [].map.call($0.querySelectorAll("tr>td>code", function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
22
+ //
18
23
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Marker
19
24
animation : PropTypes . any ,
20
25
attribution : PropTypes . any ,
@@ -72,23 +77,7 @@ export default class MarkerCreator extends Component {
72
77
static _createMarker ( markerProps ) {
73
78
const { mapHolderRef} = markerProps ;
74
79
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Marker
75
- const marker = new google . maps . Marker ( composeOptions ( markerProps , [
76
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#MarkerOptions
77
- "animation" ,
78
- "attribution" ,
79
- "clickable" ,
80
- "cursor" ,
81
- "draggable" ,
82
- "icon" ,
83
- "label" ,
84
- "opacity" ,
85
- "place" ,
86
- "position" ,
87
- "shape" ,
88
- "title" ,
89
- "visible" ,
90
- "zIndex" ,
91
- ] ) ) ;
80
+ const marker = new google . maps . Marker ( composeOptions ( markerProps , markerControlledPropTypes ) ) ;
92
81
93
82
marker . setMap ( mapHolderRef . getMap ( ) ) ;
94
83
Original file line number Diff line number Diff line change @@ -16,7 +16,13 @@ export const overlayViewControlledPropTypes = {
16
16
mapPaneName : PropTypes . string ,
17
17
getPixelPositionOffset : PropTypes . func ,
18
18
position : PropTypes . object ,
19
+ children : PropTypes . node ,
20
+ // NOTICE!!!!!!
21
+ //
22
+ // Only expose those with getters & setters in the table as controlled props.
23
+ //
19
24
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
25
+ //
20
26
// https://developers.google.com/maps/documentation/javascript/3.exp/reference
21
27
} ;
22
28
@@ -33,12 +39,7 @@ export default class OverlayViewCreator extends Component {
33
39
const { mapHolderRef} = overlayViewProps ;
34
40
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#OverlayView
35
41
const overlayView = new google . maps . OverlayView ( ) ;
36
- overlayView . setValues ( composeOptions ( overlayViewProps , [
37
- "mapPaneName" ,
38
- "getPixelPositionOffset" ,
39
- "position" ,
40
- "children" ,
41
- ] ) ) ;
42
+ overlayView . setValues ( composeOptions ( overlayViewProps , overlayViewControlledPropTypes ) ) ;
42
43
43
44
overlayView . onAdd = function ( ) {
44
45
this . _containerElement = document . createElement ( "div" ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
13
13
import { default as GoogleMapHolder } from "./GoogleMapHolder" ;
14
14
15
15
export const polygonControlledPropTypes = {
16
+ // NOTICE!!!!!!
17
+ //
18
+ // Only expose those with getters & setters in the table as controlled props.
19
+ //
16
20
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
21
+ //
17
22
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Polygon
18
23
draggable : PropTypes . bool ,
19
24
editable : PropTypes . bool ,
@@ -53,13 +58,7 @@ export default class PolygonCreator extends Component {
53
58
static _createPolygon ( polygonProps ) {
54
59
const { mapHolderRef} = polygonProps ;
55
60
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Polygon
56
- const polygon = new google . maps . Polygon ( composeOptions ( polygonProps , [
57
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#PolygonOptions
58
- "draggable" ,
59
- "editable" ,
60
- "paths" ,
61
- "visible" ,
62
- ] ) ) ;
61
+ const polygon = new google . maps . Polygon ( composeOptions ( polygonProps , polygonControlledPropTypes ) ) ;
63
62
64
63
polygon . setMap ( mapHolderRef . getMap ( ) ) ;
65
64
Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
13
13
import { default as GoogleMapHolder } from "./GoogleMapHolder" ;
14
14
15
15
export const polylineControlledPropTypes = {
16
+ // NOTICE!!!!!!
17
+ //
18
+ // Only expose those with getters & setters in the table as controlled props.
19
+ //
16
20
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); })
21
+ //
17
22
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Polyline
18
23
draggable : PropTypes . bool ,
19
24
editable : PropTypes . bool ,
@@ -51,13 +56,7 @@ export default class PolylineCreator extends Component {
51
56
static _createPolyline ( polylineProps ) {
52
57
const { mapHolderRef} = polylineProps ;
53
58
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Polyline
54
- const polyline = new google . maps . Polyline ( composeOptions ( polylineProps , [
55
- // https://developers.google.com/maps/documentation/javascript/3.exp/reference#PolylineOptions
56
- "draggable" ,
57
- "editable" ,
58
- "path" ,
59
- "visible" ,
60
- ] ) ) ;
59
+ const polyline = new google . maps . Polyline ( composeOptions ( polylineProps , polylineControlledPropTypes ) ) ;
61
60
62
61
polyline . setMap ( mapHolderRef . getMap ( ) ) ;
63
62
You can’t perform that action at this time.
0 commit comments