getVisibleBounds() method doen't work
See original GitHub issuegetVisibleBounds() method doen’t work in map box v10
class ....{
.....
onRegionDidChange(){
const bounds = await this.mapBoxRef.current.getVisibleBounds();
.....}
render{
return( <Mapbox.MapView
ref={this.mapBoxRef}
{ flex: 1 }]}
onRegionDidChange={e => {
this.mapUpdate(e);
}}>
<Mapbox.Camera
ref={ref => (this.cameraBoxRef = ref)}
zoomLevel={10}
centerCoordinate={[
this.state.mapBoxInitial
? this.state.mapBoxInitial[0]
: 46.620784,
this.state.mapBoxInitial
? this.state.mapBoxInitial[1]
: 24.810133,
]}
/>
</Mapbox.MapView>)
}}
Versions (please complete the following information):
- Platform: [ Android]
- Platform OS: [ Android 9]
- Dev OS: [e.g. OSX ]
- @rnmapbox/maps Version [e.g. 10.5]
- React Native Version [e.g. 66.4]
.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:11 (3 by maintainers)
Top Results From Across the Web
zoom to fit markers doesn't work when map isn't visible
getBounds (called in getBoundsZoomLevel) returns the visible area of the map, so I'd assume you would have to zoom to fit on the...
Read more >[Android] Get visible bounds · Issue #3863 · mapbox ... - GitHub
Guys, Is is possible to get visible bounds? I haven't find any suitable method. I know how to set it (setVisibleCoordinateBounds) but getter ......
Read more >Solved: JavaScript get map visible area - Esri Community
I am looking for JavaScript API (js.arcgis.com/4.15) that enables to get the map visible area. Hence, the X,Y coordinates of the visible area...
Read more >Button | Android Developers
android:bufferType, Determines the minimum type that getText() will return. ... This view is invisible, and it doesn't take any space for layout purposes....
Read more >Debugging guide | Google Earth Engine
The following examples demonstrate errors from using a variable and method that don't exist: Error — this code doesn't work!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s happening again now on android only https://github.com/rnmapbox/maps/issues/2317
as another workaround we’re using @mapbox/geo-viewport package to estimate bounding boxes based on center, zoom level, and map width/height.
https://github.com/mapbox/geo-viewport#boundsviewport-zoom-dimensions-tilesize