草庐IT

latlngbounds

全部标签

android - 从相机位置获取 LatLngBounds

我想获取Googlemap框架右上角和左下角的LatLng以创建LatLngBounds。有可能吗? 最佳答案 这可以使用MapViewAPI轻松确定:yourMapFragment.getMap().getProjection().getVisibleRegion().latLngBounds哪个docs状态是:Thesmallestboundingboxthatincludesthevisibleregiondefinedinthisclass.或者,您也可以通过替换latLngBounds来获取投影的各个角与farLeft,f

android - GeoDataApi.getAutocompletePredictions() 中 LatLngBounds 的用途是什么?

GooglePlacesAutocompleteAPI中使用的LatLngBounds对象是什么?..和/或它是什么意思:biasingtheresultstoaspecificareaspecifiedbylatitudeandlongitudebounds?在GooglePlacesAutocomplete文档中,它说要传入LatLngBounds和AutocompleteFilter。PendingResultresult=Places.GeoDataApi.getAutocompletePredictions(mGoogleApiClient,query,bounds,auto

java - 如果为空,则检查 LatLngBounds.Builder

这是我的代码:LatLngBounds.Builderbuilder=newLatLngBounds.Builder();for(intx=firstVisibleItem;x但是这一行抛出一个错误(java.lang.IllegalStateException:noincludedpoints:doublenorth=builder.build().northeast.latitude;这是因为上面的循环根本没有运行,所以builder中没有包含任何点。如何检查构建器是否至少有一个点?我尝试了抛出上述错误的builder.build()!=null和始终为True的builder!=

android - 根据 LatLngBounds 的 GoogleMap moveCamera 或 animateCamera 不准确

我对使用CameraUpdateFactory.newLatLngBounds()的moveCamera和animateCamera的准确性有一些疑问。我比较了一个LatLngBounds对象,我创建并作为参数发送到moveCamera/animateCamera(CameraUpdateFactory.newLatLngBounds()),到map.getProjection().getVisibleRegion().latLngBoundsonCameraChange()事件甚至GoogleMap.CancelableCallback#onFinish()。它们不匹配。有人遇到过这

android - "Error using newLatLngBounds(LatLngBounds, int): Map size can' t 为零...."在 Android 上使用 react-native-maps

我得到一个错误:“使用newLatLngBounds(LatLngBounds,int)时出错:map大小不能为零。mapView很可能尚未发生布局。等待布局发生或使用newLatLngBounds(LatLngBounds,int,int,int)允许您指定map的尺寸​​”。但我为getCurrentPosition设置了一个警报,并且我正在从getCurrentPosition()接收坐标。importReact,{Component}from'react';import{View,Dimensions}from'react-native';importMapViewfrom'r

android - 谷歌地图 API v2 : LatLngBounds from CameraPosition

有没有一种简单的方法可以使用AndroidGoogleMapsAPIv2从CameraPosition获取可见map的LatLngBounds以便我可以使用OnCameraChangeListener去获取标记的新数据。mMap.setOnCameraChangeListener(newOnCameraChangeListener(){@OverridepublicvoidonCameraChange(CameraPositionposition){LatLngBoundsbounds=?;fetchNewData(bounds);}}); 最佳答案