diff --git a/docs/examples/Annotations/CustomCallout.png b/docs/examples/Annotations/CustomCallout.png index d025b51..7088169 100644 Binary files a/docs/examples/Annotations/CustomCallout.png and b/docs/examples/Annotations/CustomCallout.png differ diff --git a/docs/examples/Annotations/Heatmap.png b/docs/examples/Annotations/Heatmap.png index 84bda42..4ab5b06 100644 Binary files a/docs/examples/Annotations/Heatmap.png and b/docs/examples/Annotations/Heatmap.png differ diff --git a/docs/examples/Annotations/MarkerView.png b/docs/examples/Annotations/MarkerView.png index f26abd9..d3ddb00 100644 Binary files a/docs/examples/Annotations/MarkerView.png and b/docs/examples/Annotations/MarkerView.png differ diff --git a/docs/examples/Annotations/PointAnnotationAnchors.png b/docs/examples/Annotations/PointAnnotationAnchors.png index ce3870a..ccdcffa 100644 Binary files a/docs/examples/Annotations/PointAnnotationAnchors.png and b/docs/examples/Annotations/PointAnnotationAnchors.png differ diff --git a/docs/examples/Annotations/ShowPointAnnotation.png b/docs/examples/Annotations/ShowPointAnnotation.png index 7cd29ec..6925185 100644 Binary files a/docs/examples/Annotations/ShowPointAnnotation.png and b/docs/examples/Annotations/ShowPointAnnotation.png differ diff --git a/docs/examples/FillRasterLayer/ChoroplethLayerByZoomLevel.png b/docs/examples/FillRasterLayer/ChoroplethLayerByZoomLevel.png index 007a798..91c9c6d 100644 Binary files a/docs/examples/FillRasterLayer/ChoroplethLayerByZoomLevel.png and b/docs/examples/FillRasterLayer/ChoroplethLayerByZoomLevel.png differ diff --git a/docs/examples/FillRasterLayer/CustomVectorSource.png b/docs/examples/FillRasterLayer/CustomVectorSource.png index 507b229..f67a10b 100644 Binary files a/docs/examples/FillRasterLayer/CustomVectorSource.png and b/docs/examples/FillRasterLayer/CustomVectorSource.png differ diff --git a/docs/examples/FillRasterLayer/GeoJSONSource.png b/docs/examples/FillRasterLayer/GeoJSONSource.png index 9444818..516c8ae 100644 Binary files a/docs/examples/FillRasterLayer/GeoJSONSource.png and b/docs/examples/FillRasterLayer/GeoJSONSource.png differ diff --git a/docs/examples/FillRasterLayer/ImageOverlay.png b/docs/examples/FillRasterLayer/ImageOverlay.png index 4dee545..871c21b 100644 Binary files a/docs/examples/FillRasterLayer/ImageOverlay.png and b/docs/examples/FillRasterLayer/ImageOverlay.png differ diff --git a/docs/examples/FillRasterLayer/IndoorBuilding.png b/docs/examples/FillRasterLayer/IndoorBuilding.png index e3e5905..1d8a8e1 100644 Binary files a/docs/examples/FillRasterLayer/IndoorBuilding.png and b/docs/examples/FillRasterLayer/IndoorBuilding.png differ diff --git a/docs/examples/FillRasterLayer/QueryAtPoint.png b/docs/examples/FillRasterLayer/QueryAtPoint.png index 1fd8ce3..61ced7f 100644 Binary files a/docs/examples/FillRasterLayer/QueryAtPoint.png and b/docs/examples/FillRasterLayer/QueryAtPoint.png differ diff --git a/docs/examples/FillRasterLayer/QuerySourceFeatures.png b/docs/examples/FillRasterLayer/QuerySourceFeatures.png index eed9a3a..42f9238 100644 Binary files a/docs/examples/FillRasterLayer/QuerySourceFeatures.png and b/docs/examples/FillRasterLayer/QuerySourceFeatures.png differ diff --git a/docs/examples/FillRasterLayer/QueryWithRect.png b/docs/examples/FillRasterLayer/QueryWithRect.png index 6eaa77a..9fcd395 100644 Binary files a/docs/examples/FillRasterLayer/QueryWithRect.png and b/docs/examples/FillRasterLayer/QueryWithRect.png differ diff --git a/docs/examples/FillRasterLayer/RasterSource.png b/docs/examples/FillRasterLayer/RasterSource.png index 5ad2f40..b970314 100644 Binary files a/docs/examples/FillRasterLayer/RasterSource.png and b/docs/examples/FillRasterLayer/RasterSource.png differ diff --git a/docs/examples/FillRasterLayer/WatercolorRasterTiles.png b/docs/examples/FillRasterLayer/WatercolorRasterTiles.png index 17495f0..838b45b 100644 Binary files a/docs/examples/FillRasterLayer/WatercolorRasterTiles.png and b/docs/examples/FillRasterLayer/WatercolorRasterTiles.png differ diff --git a/docs/examples/Map/ChangeLayerColor.png b/docs/examples/Map/ChangeLayerColor.png index 8489dfd..17f8ead 100644 Binary files a/docs/examples/Map/ChangeLayerColor.png and b/docs/examples/Map/ChangeLayerColor.png differ diff --git a/docs/examples/Map/CreateOfflineRegion.png b/docs/examples/Map/CreateOfflineRegion.png index a6e5bd5..79061cd 100644 Binary files a/docs/examples/Map/CreateOfflineRegion.png and b/docs/examples/Map/CreateOfflineRegion.png differ diff --git a/docs/examples/Map/DynamicUrl.png b/docs/examples/Map/DynamicUrl.png index da223b7..a2ea4a9 100644 Binary files a/docs/examples/Map/DynamicUrl.png and b/docs/examples/Map/DynamicUrl.png differ diff --git a/docs/examples/Map/LocalizeLabels.png b/docs/examples/Map/LocalizeLabels.png index 5482035..4415e74 100644 Binary files a/docs/examples/Map/LocalizeLabels.png and b/docs/examples/Map/LocalizeLabels.png differ diff --git a/docs/examples/Map/MapAndRNNavigation.png b/docs/examples/Map/MapAndRNNavigation.png index d72d5c4..d44b35b 100644 Binary files a/docs/examples/Map/MapAndRNNavigation.png and b/docs/examples/Map/MapAndRNNavigation.png differ diff --git a/docs/examples/Map/MapUnMount.md b/docs/examples/Map/MapUnMount.md new file mode 100644 index 0000000..27b4219 --- /dev/null +++ b/docs/examples/Map/MapUnMount.md @@ -0,0 +1,58 @@ +--- +title: Map (un-)mount +tags: [] +custom_props: + example_rel_path: Map/MapUnMount.tsx +custom_edit_url: https://github.com/rnmapbox/maps/tree/master/example/src/examples/Map/MapUnMount.tsx +--- + +Showing and hiding the the map should not lead to increased memory consumption, use this example to check it on the profiler. + + +```jsx +import React, { useState, useEffect } from 'react'; +import Mapbox from '@rnmapbox/maps'; +import { Button } from '@rneui/base'; + +import sheet from '../../styles/sheet'; +import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc + +const MapUnMount = () => { + const [isMounted, setIsMounted] = useState(true); + + useEffect(() => { + Mapbox.locationManager.start(); + + return (): void => { + Mapbox.locationManager.stop(); + }; + }, []); + + return ( + <> +