File tree Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 1+ # http://editorconfig.org
2+ root = true
3+
4+ [* ]
5+ charset = utf-8
6+ end_of_line = lf
7+ indent_size = 4
8+ indent_style = space
9+ insert_final_newline = true
10+ max_line_length = 80
11+ trim_trailing_whitespace = true
12+
13+ [* .md ]
14+ max_line_length = 0
15+ trim_trailing_whitespace = false
16+
17+ [COMMIT_EDITMSG ]
18+ max_line_length = 0
Original file line number Diff line number Diff line change @@ -37,11 +37,8 @@ export default class CustomMarker extends Component {
3737 this . setState ( { error } ) ;
3838 }
3939
40- handlePress = ( ) => {
41- if ( ! markers ) {
42- markers = GLOBAL [ this . props . superCluster ] . getLeaves ( clusterId ) ;
43- }
44- this . props . onClusterPress ( coordinates , markers ) ;
40+ createPressHandler = ( markers ) => ( ) => {
41+ this . props . onClusterPress ( markers ) ;
4542 }
4643
4744 render ( ) {
@@ -213,7 +210,7 @@ export default class CustomMarker extends Component {
213210 key = { isCluster }
214211 { ...itemProps }
215212 coordinate = { coordinates }
216- onPress = { this . handlePress }
213+ onPress = { this . createPressHandler ( markers ) }
217214 >
218215 { htmlElement }
219216 </ Marker >
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export default class MapWithClustering extends Component {
2222 region : props . region || props . initialRegion ,
2323 previousRegion : props . region || props . initialRegion ,
2424 } ;
25- this . superCluster = Symbol ( 'superCluster' ) ;
25+ this . superCluster = { } ;
2626 }
2727
2828 componentWillMount ( ) {
@@ -76,7 +76,9 @@ export default class MapWithClustering extends Component {
7676 if ( item . props && item . props . coordinate && canBeClustered ) {
7777 newState . markers . push ( {
7878 item : item ,
79- properties : { point_count : 0 } ,
79+ properties : {
80+ point_count : 0 ,
81+ } ,
8082 geometry : {
8183 type : "Point" ,
8284 coordinates : [ item . props . coordinate . longitude , item . props . coordinate . latitude ]
You can’t perform that action at this time.
0 commit comments