Commit 4812b0a
Enable control of Google Maps Marker tracksViewChanges property. (react-native-maps#1705)
Fixes issue react-native-maps#1031, enabling use of custom marker images and views in
Google Maps on iOS and android.
As detailed in the Google Maps Marker documentation (kudos to
@hughvidos), map markers track view changes by default. This has meant
however that custom marker images or views on iOS and android, when
using Google Maps, cause high continuous CPU load.
The recommended use of tracksViewChanges is to enable when the marker
is being rendered or animated, then to disable it.
An example of use of tracksViewChanges would be to set it to false once
onMapReady has fired. This can be accomplished by toggling a state
property (e.g. `initialized`), and passing it to the child map markers
in their `tracksViewChanges` prop. Markers would then render correctly
on map load; CPU use falls off once the tracking ceases.1 parent 4c1570f commit 4812b0a
File tree
4 files changed
+22
-1
lines changed- lib
- components
- ios/AirGoogleMaps
4 files changed
+22
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
168 | 176 | | |
169 | 177 | | |
170 | 178 | | |
| |||
264 | 272 | | |
265 | 273 | | |
266 | 274 | | |
267 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
268 | 278 | | |
269 | 279 | | |
270 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
298 | 307 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
0 commit comments